Note that there are some explanatory texts on larger screens.

plurals
  1. POJava graphics are flashing
    primarykey
    data
    text
    <p>Okay, I understand your need for an SSCCE, so I created (my first) one.</p> <p>I managed to replicate the problem with under 200 lines of code. On my system this demo compiled and ran perfectly (only the flickering was still there of course). I stripped everything that had nothing to do with it. So basically we have two source files now: the screen manager and the game manager.</p> <p>The screen manager: <a href="http://pastebin.com/WeKpxEXW" rel="nofollow">http://pastebin.com/WeKpxEXW</a></p> <p>The game manager: <a href="http://pastebin.com/p3C5m8UN" rel="nofollow">http://pastebin.com/p3C5m8UN</a></p> <p>You can compile this code with this make file (I use a ported version of Linux' make for Windows): CC = javac BASE = nl/jorikoolstra/jLevel CLASS_FILES = classes/$(BASE)/Game/GameMain.class classes/$(BASE)/Graphics/ScreenManager.class</p> <pre><code>jLevel: $(CLASS_FILES) @echo Done. classes/%.class : src/%.java @echo Compiling src/$*.java to $@ [command: $(CC) src/$*.java ] ... @$(CC) -Xlint:unchecked -d classes -classpath src src/$*.java </code></pre> <p>Where the source files are placed in the <code>/src</code> directory and the classes in the <code>/classes</code> directory.</p> <p>After compilation to byte-code the game can be started using the following .bat file:</p> <pre><code>@set STARUP_CLASS=nl.jorikoolstra.jLevel.Game.GameMain @set ARGUMENTS=1280 1024 32 @java -cp classes;resources %STARUP_CLASS% %ARGUMENTS% </code></pre> <p>Note that the <code>ARGUMENT</code> variable depends on your own screen settings and that you have to change it so that the game is displayed in the right resolution for your screen.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload