Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (408)
games submitted by our members
Games in WIP (293)
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  
  Depth Buffer: Linux vs. Windows  (Read 2070 times)
0 Members and 1 Guest are viewing this topic.
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Posted 2003-07-14 13:46:43 »

Ok, I'm setting the Display in the following way:

gl = new GL(title, bpp, 1, 1, 1);

for fullscreen and

gl = new GL(title, x, y, width, height, bpp, 0, 0, 0);

Works great in windows. However, same machine booted into Redhat 9.0 has MAJOR depth issues. Basically any depth issue that can occur is occurring.

I don't think I'm fully understanding how to use the alpha, depth and stencil parameters. For the life of me I don't remember why I'm using 1,1,1 for fullscreen and 0,0,0 for windowed. I must have been told to do that at some point. I know there has been discussion on how to properly use this, but can someone take me through it one more time. How would I insure that the alpha, stencil and depth buffers are set up properly for any given card? And why would it work on windows but not linux for the same machine?


Don't send a man to do a monkey's work.
Offline elias

Senior Member





« Reply #1 - Posted 2003-07-14 13:55:08 »

http://www.JavaGaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=LWJGL;action=display;num=1054959018

Basicly, the three parameters are the _minimum_ allowed buffer size for depth, stencil and alpha. Specifying 0 for any of them allows LWJGL to return a window with no support for that particular buffer. So if you need either of the buffers, set the value to at least 1.

- elias

Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #2 - Posted 2003-07-14 14:15:39 »

Ok, when I set them to 1,1,1 for windowed, I get:

Could not find a matching pixel format

in Linux.


BTW: thanks for the link, I knew I saw that thread somewhere, but was unable to locate it.

Don't send a man to do a monkey's work.
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline elias

Senior Member





« Reply #3 - Posted 2003-07-14 14:36:26 »

You needed a depth buffer only, right? So what if you pass 1 for depth and 0 for the others?

BTW, what gfx card do you have?

BTW2, you can check out available mode combinations with 'glxinfo', thereby checking if LWJGL is doing something wrong.

- elias

Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #4 - Posted 2003-07-14 16:21:54 »

Ok, don't have access to the machine at the moment, but I'll try that ASAP. It has a Geforce 1 in it. If switching to:

0,1,0 doesn't work, I'll check out the glxinfo for any wierdness.

Don't send a man to do a monkey's work.
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #5 - Posted 2003-07-15 13:28:58 »

Ok, when I set 1 to ONLY the depth buffer I get the error (in linux):

ALLVARLIG: Failed to create display due to java.lang.Exception: Mode not supported by hardware

Which is happening with some windows machines as well. See: http://www.java-gaming.org/cgi-bin/JGNetForums/YaBB.cgi?board=Announcements;action=display;num=1057864152;start=30

Therefore, I think that all my current errors of my app are leading back to the same culprit... not setting pixel,depth,alpha correctly. If 1 causes an error, what is my other choice?

Don't send a man to do a monkey's work.
Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #6 - Posted 2003-07-15 13:40:22 »

Just try a more "reasonable" value for depth if you need a depth buffer - 16 is a good choice.

Cas Smiley

Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #7 - Posted 2003-07-15 13:47:34 »

With my limited knowledge of graphics cards: Will 16 cause any problems or does every modern card support 16? Does the same go for pixel and alpha?

Don't send a man to do a monkey's work.
Offline elias

Senior Member





« Reply #8 - Posted 2003-07-15 13:58:47 »

alpha should be at most 8. And you probably don't need it at all. The alpha bits you specify is not the number of alpha bits you can use in e.g. textures etc. but how many bits of alpha in the _framebuffer_. And you don't need framebuffer alpha unless you do fancy multipass blending in it.

- elias

Offline elias

Senior Member





« Reply #9 - Posted 2003-07-15 14:02:48 »

 ALLVARLIG: Failed to create display due to java.lang.Exception: Mode not supported by hardware


BTW, that "Mode not supported by hardware" exception does not look like it's from linux lwjgl. Are you sure you gave the right error?

Games published by our own members! Check 'em out!
Try the Free Demo of Titan Attacks
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #10 - Posted 2003-07-15 14:12:09 »

You're right, that's from the windows version. I didn't have the error at hand, I just knew it was something similar. If I remember right it was something about bad display mode.

Don't send a man to do a monkey's work.
Offline Mojomonkey

Senior Member




ooh ooh eee eeee


« Reply #11 - Posted 2003-07-15 14:15:27 »

Ok, after further conversation with the person who is testing the linux version for me, it turns out the error is actually caught by my application because no valid DisplayMode is found.

Write once, run anywhere. my ass.

Don't send a man to do a monkey's work.
Offline kevglass
« League of Dukes »

JGO Kernel


Medals: 54
Projects: 20


Mentally unstable, best avoided.


« Reply #12 - Posted 2003-07-15 14:42:09 »

I'd imagine the "write once, run anywhere" idea goes out of the window as soon as you start using native libraries (like LWJGL).  Tongue

Kev

Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #13 - Posted 2003-07-16 07:54:05 »

You can write once, run anywhere, but you have to understand that you can do it wrongly! The problem you've got here is video drivers being a bit underdeveloped.

Cas Smiley

Offline elias

Senior Member





« Reply #14 - Posted 2003-07-16 08:29:32 »

I'd say underdeveloped X. He's probably running into the cannot-switch-colordepth-or-frequency-under-X problem.

- elias

Offline princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


Eh? Who? What? ... Me?


« Reply #15 - Posted 2003-07-16 14:26:47 »

Can you explain XFree86 and X to me in about 4 sentences, and where we fit in?

Cas Smiley

Offline elias

Senior Member





« Reply #16 - Posted 2003-07-16 15:32:34 »

I could try:

XFree86 is a free X server an ancient standard common on *nix. An X server is what the win32 GUI is to you win32 guys, controlling the mouse, keyboard and most importantly, the graphics card.

When we want to show an opengl window and fetch input from a message loop, I have to ask the X server for it.  An OpenGL driver has to speak with the X server and that's why I'm unable to switch color depth and frequency on the fly. The X mode switch extention simply does not supply API entries for it.

BTW, the window mode switching is even an extention to the X standard similar to NV_* extentions in GL.

- elias

Offline swpalmer

JGO Coder




Where's the Kaboom?


« Reply #17 - Posted 2003-07-16 17:14:42 »

The ancient nature of X is the big problem.  It seems that it was designed to support the concept of an X terminal - a "dumb" terminal that supported not just text, but a GUI.

For that it works ok... but for the primary graphics interface on a desktop machine it is utter crap.  (Note that modern Unix OS derivatives such as BEOS and OS X do not work on top of X Windows, but rather support running an X server on top of their native GUI.. it just works better having it that way around.)

Offline PlanetMongo

Senior Newbie




Follow the yellow line.  Don't EAT the yellow line


« Reply #18 - Posted 2003-07-16 20:01:17 »

elias:
Since you're the resident Linux guy (am I correct?), maybe you could answer a simple question:  Based upon this thread, I've come to a semi-conclusion that games written that run on Linux using LWJGL will more than likely run on Windows, but not vice versa, in the "unless you're really careful" context?

I'm in the process of switching completely back over to Linux (again), but would still like my "creations" to run on multiple platforms with a minimal of rebooting (although I can foresee that happening anyway...) Actually, now that I've pretty much got 2 systems, I'm probably just going to keep one a strictly Win2k box (mainly for Adobe Premiere and After Effects, but can use it as a testbox) and the other strictly Redhat Linux 9.  LWJGL could always use another Linux tester, right?  Smiley

If you were me, you'd be good lookin - six string samurai
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (131 views)
2013-05-17 21:29:12

alaslipknot (140 views)
2013-05-16 21:24:48

gouessej (170 views)
2013-05-16 00:53:38

gouessej (164 views)
2013-05-16 00:17:58

theagentd (174 views)
2013-05-15 15:01:13

theagentd (159 views)
2013-05-15 15:00:54

StreetDoggy (203 views)
2013-05-14 15:56:26

kutucuk (227 views)
2013-05-12 17:10:36

kutucuk (227 views)
2013-05-12 15:36:09

UnluckyDevil (230 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.142 seconds with 20 queries.