Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (483)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / OpenGL Development / Re: 2D Tile problems, any ideas? on: 2005-10-18 13:10:20
Yes, GL_NEAREST.

Enable vsync? Hmm, is that possible in windowed mode? And how do I do it? (Sorry for the stupid questions, but im learning.)
2  Java Game APIs & Engines / OpenGL Development / Re: 2D Tile problems, any ideas? on: 2005-10-18 00:05:47
AH!
 First problem solved! Gah, spent 3 hours on the web looking for it, posted here, 10 minutes later, found solution.

Solution: load the textures as this:
GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER,GL11.GL_NEAR);
GL11.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAR);

However  the second problem is still there!
This "flikering" when the player sprite is moving sideways, and the game is scrolling fast.
 
3  Java Game APIs & Engines / OpenGL Development / 2D Tile problems, any ideas? on: 2005-10-17 22:59:38
Hi!
I have a 2D engine (ortho mode and frustrum, does not matter) which tiles the screen with 32x32tiles, stored  in 256x256 tileMap.
When the tiles are drawn, (this is a fast side scroller) the gap betwen the tiles can be seen,  (fugly). The background is bright, tiles dark.

Also, the view is centred on the character, and when the character moves fast in one or other direction, (same sprite) I get this wierd
vertical scanline effect, depending on the speed of the charecter, the "scanlines" can be describes as fast moving highlighting lines. Or flicker.
Any ideas why this happens?

Every sprite is a quad. 
THis is the  GL init:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
//Go into orthographic projection mode
           GL11.glMatrixMode(GL11.GL_PROJECTION);
            GL11.glLoadIdentity();
            GLU.gluOrtho2D(0.0f, (float)GAMEWIDTH, 0.0f, (float)GAMEHEIGHT);
            GL11.glMatrixMode(GL11.GL_MODELVIEW);
            GL11.glLoadIdentity();
            GL11.glViewport(0, 0, GAMEWIDTH,GAMEHEIGHT);
           
            //enable textures since we're going to use these for our sprites
           GL11.glEnable(GL11.GL_TEXTURE_2D);
           
            //disable the OpenGL depth test since we're rendering 2D graphics
           GL11.glDisable(GL11.GL_DEPTH_TEST);
           
            //Enable blending for OpenGL
           GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GL11.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, GL11.GL_MODULATE);
           


4  Java Game APIs & Engines / Java 2D / Re: Best possible FPS achieved? on: 2005-10-11 11:13:59
Thanks for the fast reply.   Smiley
5  Java Game APIs & Engines / Java 2D / Re: Best possible FPS achieved? on: 2005-10-11 09:21:49
So it all comes down to Using LWJGL ...   Undecided
But then I loose Applets. Hmm, its a hard descision.

How portable is LWJGL in practise?
6  Java Game APIs & Engines / Java 2D / Best possible FPS achieved? on: 2005-10-10 23:32:16
Hi!
Im quite new to JavaGaming, but I made a demo to test the performance om my p4, 3GHz, radeon card machine.

I get around 60 FPS in 800x600 fullscreen and window modes.
With 1000 blits from the same BufferImage. (32x32 pixels Bitmask).
With 750 blits, I get 80 FPS.

My question is this the best I can expect from Java2D or is there something else I forgot?
I use BufferStrategy, 2 buffers for window and 3 for the fullscreen mode.

And a second question, what is the best way to implement a simple particle engine for
game explosions and smoke. Small sprites or colored pixels? And can I use transparency with
colored pixels and still retain the hardware acceleration?

Thanks in advance.

I use this code to load images:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
URL url = getClass().getResource("../../"+fileName);
           
BufferedImage tempImage = ImageIO.read(url);
           
BufferedImage image = GameFrame.gc.createCompatibleImage(tempImage.getHeight(),tempImage.getWidth(),BufferedImage.BITMASK);
           
Graphics g = image.getGraphics();
           
g.drawImage(tempImage,0,0,null);
           
g.dispose();


This is the output of  "-Dsun.java2d.trace=count"
Quote
677 calls to sun.awt.windows.Win32BlitLoops::Blit("Integer RGB DirectDraw", SrcNoEa, "Integer RGB DirectDraw")
1 call to sun.awt.windows.Win32BlitLoops$DelegateBlitBgLoop::BlitBg(Any, SrcNoEa, "Integer RGB DirectDraw with 1 bit transp")
1 call to sun.java2d.loops.Blit::Blit(IntRgb, SrcNoEa, IntRgb)
1 call to sun.java2d.loops.OpaqueCopyAnyToArgb::Blit(Any, SrcNoEa, IntArgb)
1015840 calls to sun.awt.windows.Win32BlitLoops::Blit("Integer RGB DirectDraw with 1 bit transp", SrcOverNoEa, "Integer RGB DirectDraw")
680 calls to DDFillRect
1 call to sun.java2d.loops.MaskBlit::MaskBlit(IntArgb, AnyAlpha, IntArgbBm)
1 call to sun.java2d.loops.MaskBlit$General::MaskBlit(Any, SrcOverNoEa, IntArgbBm)
1 call to sun.java2d.loops.Blit$GeneralMaskBlit::Blit(Any, SrcOverNoEa, IntArgbBm)
1 call to sun.java2d.loops.SetFillRectANY::FillRect(AnyColor, SrcNoEa, Any)
2 calls to sun.java2d.loops.Blit::Blit(IntArgbBm, SrcOverNoEa, IntRgb)
2034 calls to sun.java2d.loops.DrawGlyphList::DrawGlyphList(OpaqueColor, SrcNoEa, AnyInt)
1019240 total calls to 12 different primitives
7  Java Game APIs & Engines / Java 2D / Re: Best way for particles? on: 2004-11-12 04:59:10
Awsome code!
And I was killing my self how to create a list
for particles that does reuse objects. =)
Thanks!

Ill add an "active" static member to so I know which particles to draw.
8  Java Game APIs & Engines / Java 2D / Best way for particles? on: 2004-11-11 19:30:29
Hi,
Im implementing an experimental verson of CRobots in java, my own style (yes i know there is a JRobots  Roll Eyes ) Well I need a particle engine, in working in Java2D 1.5. Is the best way to use small images? or pixels? How do
I avoid creating new objects on the heap?
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (15 views)
2014-08-22 19:31:30

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (38 views)
2014-08-06 19:49:38
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!