Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (540)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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 2761 times)
0 Members and 1 Guest are viewing this topic.
Offline Mojomonkey

Senior Devvie




ooh ooh eee eeee


« Posted 2003-07-14 11: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 Devvie





« Reply #1 - Posted 2003-07-14 11: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 Devvie




ooh ooh eee eeee


« Reply #2 - Posted 2003-07-14 12: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!
Legends of Yore - The Casual Retro Roguelike
Offline elias

Senior Devvie





« Reply #3 - Posted 2003-07-14 12: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 Devvie




ooh ooh eee eeee


« Reply #4 - Posted 2003-07-14 14: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 Devvie




ooh ooh eee eeee


« Reply #5 - Posted 2003-07-15 11: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

« JGO Spiffy Duke »


Medals: 437
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #6 - Posted 2003-07-15 11: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 Devvie




ooh ooh eee eeee


« Reply #7 - Posted 2003-07-15 11: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 Devvie





« Reply #8 - Posted 2003-07-15 11: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 Devvie





« Reply #9 - Posted 2003-07-15 12: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!
Legends of Yore - The Casual Retro Roguelike
Offline Mojomonkey

Senior Devvie




ooh ooh eee eeee


« Reply #10 - Posted 2003-07-15 12: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 Devvie




ooh ooh eee eeee


« Reply #11 - Posted 2003-07-15 12: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

« JGO Spiffy Duke »


Medals: 218
Projects: 24
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #12 - Posted 2003-07-15 12: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

« JGO Spiffy Duke »


Medals: 437
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #13 - Posted 2003-07-16 05: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 Devvie





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

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

- elias

Offline princec

« JGO Spiffy Duke »


Medals: 437
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


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

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

Cas Smiley

Offline elias

Senior Devvie





« Reply #16 - Posted 2003-07-16 13: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


Exp: 12 years


Where's the Kaboom?


« Reply #17 - Posted 2003-07-16 15: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 18: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.

 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (23 views)
2014-12-23 03:34:11

rwatson462 (53 views)
2014-12-15 09:26:44

Mr.CodeIt (45 views)
2014-12-14 19:50:38

BurntPizza (85 views)
2014-12-09 22:41:13

BurntPizza (110 views)
2014-12-08 04:46:31

JscottyBieshaar (78 views)
2014-12-05 12:39:02

SHC (89 views)
2014-12-03 16:27:13

CopyableCougar4 (96 views)
2014-11-29 21:32:03

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

toopeicgaming1999 (152 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

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