I’m developing a game (ya thats rare here ? =D)
anyway, I have windows and linux as native OS’ on my pc
naturally I would like my game to run smooth on linux aswell
so I tried using the OpenGL pipeline “-Dsun.java2d.opengl=True”
what happens is that, while the framerate is extremely good (even better than running my game on windows), the output is corrupted.
The screen flickers very frequently and there are to fonts/text output.
I mean flickering output of game almost always make me think of double buffering issues.
so maybe I need different code for OpenGL ? well that shouldn’t be the case but it might be.
my basic rendering process is like
Graphics2D gg;
BufferStrategy strategy;
...
gg = DisplayMan.getGraphics();
gg.setColor (getBackground ());
gg.fillRect (0, 0, this.getSize().width, this.getSize().height);
gg.setColor (getForeground());
renderShit (gg); // rendering of the game obviously
gg.dispose();
try
{
strategy().show();
}
catch(Exception ok){}
kinda like that. Now as said, it works fine without OpenGL, but using it, I get the mentioned problems.
I also like to add that: when using Linux and don’t use OpenGL I get only like 20-30 FPS, using OpenGL I get like 100 FPS but with the problems.
also interesting: If I use OpenGL pipeline on windows, I have the same problems AND only 1 FPS =D
your thoughts ?