Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (593)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  SetFullScreen Issue  (Read 2777 times)
0 Members and 1 Guest are viewing this topic.
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Posted 2010-02-22 22:34:45 »

Back in 2005 I wrote a 16k program for the never-happened LWJGL16k comp.  I noticed a while back that it no longer worked and decided to
recompile it against LWJGL 2.3  (The point being it hasn't been compiled since LWJGL 0.98!)

I compiled against Java 1.5 libraries.  Might try 1.6 just in case.

I found it crashes if I go full screen after creating a display context, but works if use the setDisplayModeAndFullScreen() call.
This laptop's got an Intel GMA 4500 chipset, so nothing special.  Could be drivers are not up to it.  But there is a horrid not handled exception

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
Dodgy code
            DisplayMode modes[] = Display.getAvailableDisplayModes();
            for (int i=0; i< modes.length; i++) {
               DisplayMode m = modes[i];
               int bpp = Display.getDisplayMode().getBitsPerPixel();
               if (m.getBitsPerPixel() == bpp
                ) {
                   if ( m.getWidth() <= 800 && m.getHeight() <= 600 &&
                        m.getFrequency() <= 85)
                       mode = m;
                   if ( m.getWidth() == 800 && m.getHeight() == 600 &&
                        m.getFrequency() == 60)
                       break;
                   }
            }
                       
            Display.setDisplayMode(mode);
//Display.setDisplayModeAndFullscreen(mode);
            Display.create();
            Display.setFullscreen(true);

If I use setDisplayModeAndFullScreen(mode) and comment out the other mode & fullscreen  code, all is fine (unless I try to change fullscreen mode later, when we crash again.)
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
---------------  T H R E A D  ---------------

Current thread (0x005c79f8):  JavaThread "main" [_thread_in_native, id=4268]

siginfo: ExceptionCode=0xc0000005, writing address 0x00000140

Registers:
EAX=0x00000000, EBX=0x4c011242, ECX=0x00283980, EDX=0x00000012
ESP=0x0006f598, EBP=0x00283d18, ESI=0x04a70068, EDI=0x00283980
EIP=0x044c1fa6, EFLAGS=0x00010202

Top of Stack: (sp=0x0006f598)
0x0006f598:   002906d0 00283980 04a70068 04b2fed0
0x0006f5a8:   0006fb84 0493ba68 00000000 046f5491
0x0006f5b8:   00000001 00290630 00000000 00000000
0x0006f5c8:   0006f700 000805dc 000010ac 7702f0e7
0x0006f5d8:   001eb7c0 00000002 001ed020 00216110
0x0006f5e8:   77018822 0006f608 7702f0e7 001ecea0
0x0006f5f8:   00000002 001ecf20 00216038 77018822
0x0006f608:   0006f624 7702f0e7 001eb7c0 00000002

Instructions: (pc=0x044c1fa6)
0x044c1f96:   8d 00 00 8b ce e8 f0 98 00 00 8b 86 fc 80 00 00
0x044c1fa6:   83 80 40 01 00 00 ff 75 13 8b 88 3c 01 00 00 85


Stack: [0x00030000,0x00070000),  sp=0x0006f598,  free space=253k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ig4icd32.dll+0x31fa6]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j  org.lwjgl.opengl.WindowsContextImplementation.nMakeCurrent(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)V+0
j  org.lwjgl.opengl.WindowsContextImplementation.makeCurrent(Lorg/lwjgl/opengl/PeerInfo;Ljava/nio/ByteBuffer;)V+7
j  org.lwjgl.opengl.Context.makeCurrent()V+46
j  org.lwjgl.opengl.Display.makeCurrent()V+25
j  org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval()V+0
j  org.lwjgl.opengl.Display.setDisplayModeAndFullscreenInternal(ZLorg/lwjgl/opengl/DisplayMode;)V+88
j  org.lwjgl.opengl.Display.setFullscreen(Z)V+4
J  G.<init>()V
v  ~OSRAdapter
j  G.main([Ljava/lang/String;)V+4
v  ~StubRoutines::call_stub

---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )
  0x037ed1d0 JavaThread "Thread-1" daemon [_thread_in_native, id=5520]
  0x0155aad8 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=5684]
  0x015890a0 JavaThread "CompilerThread0" daemon [_thread_blocked, id=3060]
  0x0155a950 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3356]
  0x01559030 JavaThread "Finalizer" daemon [_thread_blocked, id=1872]
  0x01558268 JavaThread "Reference Handler" daemon [_thread_blocked, id=1768]
=>0x005c79f8 JavaThread "main" [_thread_in_native, id=4268]

Other Threads:
  0x01581c78 VMThread [id=3216]
  0x0154aa20 WatcherThread [id=3584]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

Heap
 def new generation   total 576K, used 558K [0x239a0000, 0x23a40000, 0x23e80000)
  eden space 512K,  96% used [0x239a0000, 0x23a1bac8, 0x23a20000)
  from space 64K,  99% used [0x23a30000, 0x23a3fff8, 0x23a40000)
  to   space 64K,   0% used [0x23a20000, 0x23a20000, 0x23a30000)
 tenured generation   total 2528K, used 1831K [0x23e80000, 0x240f8000, 0x279a0000)
   the space 2528K,  72% used [0x23e80000, 0x24049df0, 0x24049e00, 0x240f8000)
 compacting perm gen  total 8192K, used 1210K [0x279a0000, 0x281a0000, 0x2b9a0000)
   the space 8192K,  14% used [0x279a0000, 0x27acea28, 0x27acec00, 0x281a0000)
    ro space 8192K,  67% used [0x2b9a0000, 0x2bf04558, 0x2bf04600, 0x2c1a0000)
    rw space 12288K,  47% used [0x2c1a0000, 0x2c750a70, 0x2c750c00, 0x2cda0000)

Dynamic libraries:
0x00400000 - 0x0040d000    C:\Program Files\Java\jdk1.5.0_21\bin\java.exe
0x76fd0000 - 0x7710c000    C:\Windows\SYSTEM32\ntdll.dll
0x769b0000 - 0x76a84000    C:\Windows\system32\kernel32.dll
0x751a0000 - 0x751ea000    C:\Windows\system32\KERNELBASE.dll
0x76860000 - 0x76900000    C:\Windows\system32\ADVAPI32.dll
0x767b0000 - 0x7685c000    C:\Windows\system32\msvcrt.dll
0x771e0000 - 0x771f9000    C:\Windows\SYSTEM32\sechost.dll
0x76320000 - 0x763c1000    C:\Windows\system32\RPCRT4.dll
0x6d740000 - 0x6d8de000    C:\Program Files\Java\jdk1.5.0_21\jre\bin\client\jvm.dll
0x766e0000 - 0x767a9000    C:\Windows\system32\USER32.dll
0x75430000 - 0x7547e000    C:\Windows\system32\GDI32.dll
0x75420000 - 0x7542a000    C:\Windows\system32\LPK.dll
0x763d0000 - 0x7646d000    C:\Windows\system32\USP10.dll
0x744b0000 - 0x744e2000    C:\Windows\system32\WINMM.dll
0x76200000 - 0x7621f000    C:\Windows\system32\IMM32.DLL
0x75480000 - 0x7554c000    C:\Windows\system32\MSCTF.dll
0x75050000 - 0x7509b000    C:\Windows\system32\apphelp.dll
0x6d300000 - 0x6d308000    C:\Program Files\Java\jdk1.5.0_21\jre\bin\hpi.dll
0x76a90000 - 0x76a95000    C:\Windows\system32\PSAPI.DLL
0x6d710000 - 0x6d71c000    C:\Program Files\Java\jdk1.5.0_21\jre\bin\verify.dll
0x6d380000 - 0x6d39d000    C:\Program Files\Java\jdk1.5.0_21\jre\bin\java.dll
0x6d730000 - 0x6d73f000    C:\Program Files\Java\jdk1.5.0_21\jre\bin\zip.dll
0x10000000 - 0x10016000    C:\User\Java\SharpShooter16K\native\jinput-dx8.dll
0x67a60000 - 0x67a90000    C:\Windows\system32\DINPUT8.dll
0x73cd0000 - 0x73d10000    C:\Windows\system32\uxtheme.dll
0x73a00000 - 0x73a09000    C:\Windows\system32\HID.DLL
0x76470000 - 0x7660d000    C:\Windows\system32\SETUPAPI.DLL
0x75280000 - 0x752a7000    C:\Windows\system32\CFGMGR32.dll
0x76aa0000 - 0x76b2f000    C:\Windows\system32\OLEAUT32.dll
0x76d30000 - 0x76e8c000    C:\Windows\system32\ole32.dll
0x75400000 - 0x75412000    C:\Windows\system32\DEVOBJ.dll
0x752b0000 - 0x752dd000    C:\Windows\system32\WINTRUST.dll
0x752e0000 - 0x753fc000    C:\Windows\system32\CRYPT32.dll
0x75190000 - 0x7519c000    C:\Windows\system32\MSASN1.dll
0x73380000 - 0x733a1000    C:\Windows\system32\ntmarta.dll
0x76900000 - 0x76945000    C:\Windows\system32\WLDAP32.dll
0x739e0000 - 0x739f3000    C:\Windows\system32\dwmapi.dll
0x03dd0000 - 0x03de5000    C:\User\Java\SharpShooter16K\native\jinput-raw.dll
0x03e80000 - 0x03ebf000    C:\User\Java\SharpShooter16K\native\lwjgl.dll
0x672e0000 - 0x673a8000    C:\Windows\system32\OPENGL32.dll
0x67570000 - 0x67592000    C:\Windows\system32\GLU32.dll
0x6d5f0000 - 0x6d6d7000    C:\Windows\system32\DDRAW.dll
0x6d5e0000 - 0x6d5e6000    C:\Windows\system32\DCIMAN32.dll
0x74620000 - 0x74629000    C:\Windows\system32\VERSION.dll
0x751f0000 - 0x75274000    C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7600.16385_none_ebf82fc36c758ad5\COMCTL32.dll
0x04490000 - 0x04a62000    C:\Windows\system32\ig4icd32.dll
0x04c10000 - 0x04fce000    C:\Windows\system32\ig4dev32.dll
0x750a0000 - 0x750ac000    C:\Windows\system32\CRYPTBASE.dll
0x76610000 - 0x76693000    C:\Windows\system32\CLBCatQ.DLL
0x71680000 - 0x716f9000    C:\Windows\system32\mscms.dll
0x74780000 - 0x74797000    C:\Windows\system32\USERENV.dll
0x75120000 - 0x7512b000    C:\Windows\system32\profapi.dll
0x672a0000 - 0x672d8000    C:\Windows\system32\icm32.dll

VM Arguments:
jvm_args: -Dfile.encoding=UTF-8
java_command: G
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Program Files\Common Files\Roxio Shared\DLLShared\;C:\Program Files\Common Files\Roxio Shared\10.0\DLLShared\;C:\Windows\System32\WindowsPowerShell\v1.0\
USERNAME=Alan
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 23 Stepping 10, GenuineIntel



---------------  S Y S T E M  ---------------

OS: Windows 7 Build 7600

CPU:total 2 (cores per cpu 2, threads per core 1) family 6 model 7 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2

Memory: 4k page, physical 2097151k(1678776k free), swap 4194303k(4194303k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_21-b01) for windows-x86, built on Aug 24 2009 12:50:05 by "java_re" with MS VC++ 6.0

time: Mon Feb 22 21:49:13 2010
elapsed time: 2 seconds

Time flies like a bird. Fruit flies like a banana.
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #1 - Posted 2010-02-22 22:49:21 »

Tried

1  
2  
3  
4  
5  
6  
7  
8  
            mode = org.lwjgl.util.Display.setDisplayMode(
                   org.lwjgl.util.Display.getAvailableDisplayModes(
                   640, 480, -1, -1, 16, 32, 60, 85),
                   new String[] {"width=800", "height=600", "bpp="+
                   Display.getDisplayMode().getBitsPerPixel(), "freq=60"});
            Display.setDisplayMode(mode);
            Display.create();
            Display.setFullscreen(true);


Same problem, unless I move the setFullScreen() before Display.create();
Edit: I also tried setting width/height to my display's native resolution - but still the same behaviour

So... I don't appear to be able to go Full Screen once I've created the display context.

Edit

This looks suspiciously similar...
http://www.java-gaming.org/topics/lwjgl-2-1-0-vm-crash/20481/view.html#lastPost

Time flies like a bird. Fruit flies like a banana.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #2 - Posted 2010-02-22 23:28:14 »

looks similar .. and lo and behold - same driver class Smiley ig4icd32.dll vs igldev32.dll

Since I dont have the hardware, I cannot debug it - but very weird indeed

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Alan_W

JGO Knight


Medals: 8
Projects: 3


Java tames rock!


« Reply #3 - Posted 2010-02-23 00:13:39 »

Destroying the display and then reseting mode, fullscreen and then recreating the display appears to work.  I get no crashes.  Works fine in setup code when I created the context, deliberately destroyed it, then proceded to set mode and full screen before creating a Display again.

Unfortunately the Full Screen/Window toggle code suffers in that I'm losing the rest of the opengl context setup. So no crashes, but only the 2D overlay is currently showing up, which is as expected. 

I tried upgrading the drivers (using the windows automated feature) and it downloaded a new file, but this turned out to be a fancy new Control Panel Applet, with no change to the actual drivers.

Conclusion: I've reordered the calls in the initialisation code so it works and disabled the full screen/windowed toggle.  I have a work around should I really want to put the toggle back in.

Time flies like a bird. Fruit flies like a banana.
Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #4 - Posted 2010-02-23 08:21:46 »

you could try and post the issue @ http://lwjgl.org/forum/index.php and see if there others with similar drivers with similar issues - and possibly able to debug the issues.

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

PocketCrafter7 (11 views)
2014-11-28 16:25:35

PocketCrafter7 (6 views)
2014-11-28 16:25:09

PocketCrafter7 (6 views)
2014-11-28 16:24:29

toopeicgaming1999 (73 views)
2014-11-26 15:22:04

toopeicgaming1999 (63 views)
2014-11-26 15:20:36

toopeicgaming1999 (15 views)
2014-11-26 15:20:08

SHC (29 views)
2014-11-25 12:00:59

SHC (27 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (27 views)
2014-11-24 19:59:16
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

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
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!