Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
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  
  Changing from GL11 to OGL 3  (Read 1161 times)
0 Members and 1 Guest are viewing this topic.
Offline HeroesGraveDev

JGO Kernel


Medals: 310
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Posted 2012-12-12 21:16:17 »

I have been using Vertex Arrays and Interleaved VBOs as described here

I thought that this was the way to go until someone said that GL11 is deprecated and we should be using OpenGL 3 with Vertex Arrays and VBOs.

I am confused as I am using Vertex Arrays and VBOs, but I am still only using GL11 and GL15, not GL30.  Huh

Can someone please clarify what I should be using, and point me to a tutorial if my current usage is inefficient.

Thanks!  Smiley

Offline theagentd

« JGO Bitwise Duke »


Medals: 366
Projects: 2
Exp: 8 years



« Reply #1 - Posted 2012-12-12 21:36:31 »

The newer OpenGL classes (GL30, GL31, etc) still rely on functions and enums from the older ones. The screen is still cleared with GL11.glClear(), VBOs are still created with GL15.glGenBuffers() and shaders programs are still created with GL20.glCreateProgram(). The difference is that a number of functions in those classes have been deprecated and can no longer be used (unless you're using the compatibility mode, which kind of defeats the purpose of it). For example, here's a line from when using sampler objects which store how a texture is sampled (filtering, wrap modes, etc) separately instead of inside the texture:

1  
GL33.glSamplerParameteri(id, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);


As you can see, the old GL11 enums are still used although the function glSamplerParameteri() is in GL33.

I'd like to point out that switching to OGL3 does not only mean that you'll have to use VBOs; the whole fixed functionality pipeline has been removed. For starters, it's impossible to draw anything at all without a shader.

Myomyomyo.
Offline HeroesGraveDev

JGO Kernel


Medals: 310
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #2 - Posted 2012-12-12 21:40:09 »

Okay, I'll finish my current project, then think about switching afterwards

I did know that some methods were not deprecated in the older classes, but I didn't know which ones, so I wanted to make sure.

Can you confirm whether the VAO method in the article mentioned in my first post is good to use or not?

Thanks

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

« JGO Bitwise Duke »


Medals: 366
Projects: 2
Exp: 8 years



« Reply #3 - Posted 2012-12-12 22:15:17 »

From that article, any of those techniques that use VBOs are all okay (indexed, interleaved, etc). Vertex arrays are deprecated though (simply sending in a FloatBuffer to gl*****Pointer()). To convert them to OGL3 you'll also need to use shaders with custom shader attributes instead of the built-in shader attributes. glVertexPointer(), glColorPointer(), glTexCoordPointer(), etc are all replaced by a generic function called glVertexAttribPointer() and glEnableClientState() is replaced by glEnableVertexAttrib(). But for now, stick to using VBOs the way you currently do and worry about shaders in your next project! Wink

Myomyomyo.
Offline gouessej
« Reply #4 - Posted 2012-12-13 08:10:38 »

I'd like to point out that switching to OGL3 does not only mean that you'll have to use VBOs; the whole fixed functionality pipeline has been removed. For starters, it's impossible to draw anything at all without a shader.
It would be more explicit if there were separate interfaces for OpenGL 3.1 backward compatible profile and OpenGL 3.1 forward compatible profile. The fixed functionality pipeline has been removed from the core but it is still available in the optional extension ARB_compatibility.

Offline theagentd

« JGO Bitwise Duke »


Medals: 366
Projects: 2
Exp: 8 years



« Reply #5 - Posted 2012-12-13 10:03:54 »

I'd like to point out that switching to OGL3 does not only mean that you'll have to use VBOs; the whole fixed functionality pipeline has been removed. For starters, it's impossible to draw anything at all without a shader.
It would be more explicit if there were separate interfaces for OpenGL 3.1 backward compatible profile and OpenGL 3.1 forward compatible profile. The fixed functionality pipeline has been removed from the core but it is still available in the optional extension ARB_compatibility.

http://lwjgl.org/javadoc/org/lwjgl/opengl/ContextAttribs.html

Set it up and feed it into Display.create().

Myomyomyo.
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.

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

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

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

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

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

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

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

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

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

toopeicgaming1999 (37 views)
2014-11-26 15:20:08
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!