Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
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  
  OpenGL states at start  (Read 2824 times)
0 Members and 1 Guest are viewing this topic.
Offline Tyecon

Senior Newbie

« Posted 2013-04-01 20:31:31 »

What should I set the OpenGL states too when I start the program?

My current code:
//Initialize OpenGL
        System.out.println("OpenGL version: "+glGetString(GL_VERSION));
        GLVersion=Float.valueOf(glGetString(GL_VERSION).split(" ")[0]);
        glClearColor(0.1f, 0.1f, 0.2f, 0f);
        if (GLVersion>=3.2) {glEnable(GL32.GL_DEPTH_CLAMP); ModernGL=true;}
        glDepthRange(0, 1);

Please have a baggy ready before looking at my code.
Offline davedes
« Reply #1 - Posted 2013-04-01 22:31:19 »

For a 2D game in the programmable pipeline, here is all the states you need:

You probably shouldn't tackle a 3D game unless you are already comfortable with the OpenGL pipeline.

Offline theagentd
« Reply #2 - Posted 2013-04-02 13:05:59 »


No need to query the OpenGL version string. You can also check for OpenGL versions directly:

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

Senior Newbie

« Reply #3 - Posted 2013-04-02 13:45:48 »

What is ARB? I see it everywhere all the time. Some kind of compatibility layer?

Please have a baggy ready before looking at my code.
Offline Danny02
« Reply #4 - Posted 2013-04-02 14:46:04 »

ARB means that is not a core feature.

every party which provides an OpenGL implementation(graphic card driver) can extend OpenGL with own extensions. You have probalby already seen some, they start with something like GL_[ATI/NV/APPLE...]_XXX or GL_EXT_XX

when other vendors decide that a extension is quite useful they make an official OpenGL extension out of it. ARB means Architecture Review Board and is a board out of a number of companies which decide how OpenGL should evolve.

After a while a ARB extension sometimes evolve into a new core feature of OpenGL.

Between these stages the API and usage of a extension can change a bit, so the first iteration of a Extension might only be usable on a Nvidia card but after the promotion to an offical extension it can be used on a lot of other graphic cards.

In your case GL_ARB_depth_clamp was based on NV_depth_clamp(written against OpenGL 1.2) and is written against OpenGL 3.1, but was included as a core feature in OpenGL 3.2.

So it might be possible that this extension is available to very old Nvidia cards with newer graphic drivers.

btw you can get all the info from the opengl registry which has an entry for every opengl extension: your example depth_clamp

Pages: [1]
  ignore  |  Print  

mercenarius (12 views)
2020-06-04 19:26:01

mercenarius (18 views)
2020-06-04 19:13:43

Riven (853 views)
2019-09-04 15:33:17

hadezbladez (5843 views)
2018-11-16 13:46:03

hadezbladez (2653 views)
2018-11-16 13:41:33

hadezbladez (6269 views)
2018-11-16 13:35:35

hadezbladez (1506 views)
2018-11-16 13:32:03

EgonOlsen (4742 views)
2018-06-10 19:43:48

EgonOlsen (5801 views)
2018-06-10 19:43:44

EgonOlsen (3292 views)
2018-06-10 19:43:20
A NON-ideal modular configuration for Eclipse with JavaFX
by philfrei
2019-12-19 19:35:12

Java Gaming Resources
by philfrei
2019-05-14 16:15:13

Deployment and Packaging
by philfrei
2019-05-08 15:15:36

Deployment and Packaging
by philfrei
2019-05-08 15:13:34

Deployment and Packaging
by philfrei
2019-02-17 20:25:53

Deployment and Packaging
by mudlee
2018-08-22 18:09:50

Java Gaming Resources
by gouessej
2018-08-22 08:19:41

Deployment and Packaging
by gouessej
2018-08-22 08:04:08 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‑
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!