few questions..

ok… im not new to game programming, because ive made a few “games”. check out my site,

i was playing with lwjgl 0.5 a while ago… but i stopped programming for a while. ive been around here b4.

now i got lwjgl 0.8 and was looking at the nehe tutorials.

so first, is there a site or tutorial that explains what all this orthograph stuff, and all the things like


GL.glShadeModel(GL.GL_SMOOTH);            // Enable Smooth Shading
    GL.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);  // Black Background
    GL.glClearDepth(1.0);                     // Depth Buffer Setup
    GL.glEnable(GL.GL_DEPTH_TEST);            // Enables Depth Testing
    GL.glDepthFunc(GL.GL_LEQUAL);             // The Type Of Depth Testing To Do

    GL.glMatrixMode(GL.GL_PROJECTION);        // Select The Projection Matrix
    GL.glLoadIdentity();    

actually does?

im completely new to opengl and 3d, and 2d using ogl, and i have no clue what that stuff does and i dont know what to look for since i have no idea how opengl works.

thanks…

What you need is the Red Book, aka the OpenGL Programming Guide:

http://www.opengl.org/documentation/red_book_1.0/

The fourth edition, covering up to OpenGL 1.4, is now in the shops, or you can download a (perfectly legal!) PDF of the first edition from that page as well.

Once you’ve got that you’ll need the OpenGL specifications:

http://www.opengl.org/documentation/spec.html

Download the PDF spec for the version of OpenGL you intend to use. If you don’t know what you want, get whatever is supported by your hardware, 1.3 or 1.4 for recent cards, 1.2 for older ones, possibly 1.1 for ill-supported cards. Check your card’s driver docs to see what it supports.

awesome thank you very much.

also when i was just playing around with creating a window, using the same code as nehe1.0 does off the lwjgl site, i can never get the window to come up without it saying that the mode is not supported. any suggestions?

Hi,

How do you set your Modes ?

Code please 8)

  • jens

well i was doing what it said in the nehe thing, which is


Window.create("Hello World",50,50,640,480,16,0,8,0);

which should’ve made a window not fullscreen, but it gave me the mode not supported error.

so then i updated my video card drivers and it worked.

but still any idea why this wouldnt have worked before i updated my drivers?

thanks.

One of my machines here has a (seemingly) similar problem. It seems that for some reason getAvailableModes is returning modes that have an unsupported refresh rate. It is a laptop with an nVidia 128MB GeForce card in it (latest detonator drivers)

well i didnt even change the display mode all i did was call window.create.

but after updating drivers on my nvidia riva tnt2, it works but it seemed to slow my computer down a little…

You generally get a much smaller selection of modes if you try and create a windowed window rather than a fullscreen window, as it depends on what your desktop is set to as to whether certain configurations are available (which is why we put so much emphasis on the way we do fullscreen mode).

Cas :slight_smile:

Hi,

for me it looks like a known programming bug (not really).
But if you write an Application using lwjgl, make sure you are
not trying only to find one Mode to set, you have to try some more. Some cards dislike Deepbuffer bit deep. some cards dislike Stencil bit depth …and so on. Most problem should be fixed only by iterating a list of Modes.

  • jens

That’s right. You should get all the available display modes, filter out the ones that aren’t acceptable, and then sort them in order of preference. Once you’ve got this sorted list of modes, you need to iterate through, trying each one in turn until it works. Then that’s your screen mode.

With windowed Windows, you’ve got very little choice but to specify your minimum requirements up front and hope for the best (as it’s unlikely you’ll get any better success trying various different combinations if you’re already going for the minimum). The driver will tend to give you more than you need if it can without sacrificing performance.

Cas :slight_smile:

Makes good sense and by falling back on other modes when one fails I have fixed my laptop’s full-screen issue. Thanks!

Just wondering though… Why does getAvailableDisplayModes include modes that the screen can’t support? For example, it includes modes that have a refresh rate of 72 when the laptop can only handle 60.

Regards

Because that’s what Windows tells us is available. Probably because Windows don’t know for sure either. Actually, what is worse than a failing mode is a mode that is outside the allowed frequency range that succeeds resulting in a black screen. The user thinks the game crashed and the game thinks that everything is OK in the world.

  • elias

Is there a good way to prevent that from occuring?

Not that I know of. My current hack is to prefer 60 Hz when sorting the modes. And if I’m not wrong, a lot of retail games do the same.

  • elias

Hi,

i allways only accept DisplayModes with 60 HZ, all other
are unsave to Init !

-jens

In the lower resolutions (800x600 or less) you’re usually safe up to 72Hz as well.

Cas :slight_smile: