Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (492)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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  
  How to use OpenGL extensions in JOGL  (Read 2176 times)
0 Members and 1 Guest are viewing this topic.
Zynaps
Guest
« Posted 2003-08-01 11:42:55 »

Good day. I try to learn Multi-Texturing in Jogl. Like in the Win32 tutorial http://www.gametutorials.com/Tutorials/opengl/OpenGL_Pg2.htm

I'm new to OpenGL and extensions. Like the tutorial, my program should ask at runtime if the extension "glActiveTextureARB" is available. So I've to use the gl.isExtensionAvailable(...), but how?
Are the Jogl extension names different to the OpenGL ones? I read the Jogl Javadoc (javadoc_public.tar.gz) which says the ARB or EXT is in front of the name, but I don't understand it. Which extension name do I have to use for glActiveTextureARB when I call gl.isExtenionsAvailable(...) ? The Jogl demos just use the function without asking if it's available.

JOGL does report this:
1  
2  
3  
4  
5  
6  
 gl.isExtensionAvailable("GL_EXT_texture_lod"). . . . . . -> true
 gl.isExtensionAvailable("GL_ARB_vertex_buffer_object") . -> true
 gl.isExtensionAvailable("GL_EXT_abgr") . . . . . . . . . -> true
 gl.isExtensionAvailable("GL_ARB_multitexture") . . . . . -> true
 gl.isExtensionAvailable("GL_activetexture"). . . . . . . -> false
 gl.isExtensionAvailable("GL_ARB_activetexture"). . . . . -> false


By the way the extension glActiveTextureARB can be found in the GlExt.h file here http://oss.sgi.com/projects/ogl-sample/ABI/glext.h  but not in the OpenGL registry http://oss.sgi.com/projects/ogl-sample/registry/ . Why is this?
Offline albanc

Senior Newbie





« Reply #1 - Posted 2003-08-01 12:05:52 »

You shouldn't confuse the extension name with the name of the OpenGL commands the extension gives you access to.
If you look at http://oss.sgi.com/projects/ogl-sample/registry/ again, you'll notice that GL_ARB_multitexture is an extension, but GL_activetexture doesn't exist as an extension (it is the command name gl.activeTexture() that you intended to convert as an extension !)

In fact, when GL_ARB_multitexture extension is marked as available, it gives you access to all the OpenGL commands associated with it, gl.activeTexture()  being one of these.
Zynaps
Guest
« Reply #2 - Posted 2003-08-01 12:57:20 »

Oh, I see. Thank you.

The C++ tutorial source code does some pointer fetching with glActiveTextureARB... so I thought I would have to do this with Jog's isExtensionAvaiable, too. :-)

In the OpenGl registry site I look at ARB_multitexturing and it says it is now standard since OpenGL 1.2.1 and "look at Gl 1.2.1 specification". I download the GL 1.2.1 PDF from www.opengl.org and voila: there I see all the new commands. Fine.

Am I correct in assuming that Jogl's glActiveTexture() and glActiveTextureARB() functions are identical?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline albanc

Senior Newbie





« Reply #3 - Posted 2003-08-01 13:02:12 »

and you can figure if a specific OpenGL function is available using :
isFunctionAvailable(String glFunctionName)
Not to confuse with :
isExtensionAvailable(String glExtensionName)  !

Regards,

Alban
Zynaps
Guest
« Reply #4 - Posted 2003-08-01 13:24:50 »

Quote
and you can figure if a specific OpenGL function is available using :
isFunctionAvailable(String glFunctionName)
Not to confuse with :
isExtensionAvailable(String glExtensionName)  !

Ok, thanks. So with isExtensionAvailable("GL_ARB_multitexture") you can see if that multitexture extension is available. The glActiveTextureARB() function being one of this extension's functions. A isFunctionAvailable("glActiveTextureARB") will result in true in this case.

But I can't imagine at the moment why I should want to ask for the function. I learned from your above posts that I ask for the extension GL_ARB_multitexture (with isExtenionAvailable) and then I should be able to call glActiveTextureARB(...).
So why a isFunctionAvailable...?
Offline DrLabman

Junior Newbie




Opengl games rock!


« Reply #5 - Posted 2003-08-01 22:15:16 »

the only time ive had to check for a function is with ati's GL_ATIX_PN_TRIANGLES also called GL_ATI_PN_TRIANGLES which isn't in the extention list when it should be,  so checking if the function glPNTrianglesiATI was available was the only way to see if i could use the extention.

In most cases you should just be able to check for the extention (or check your opengl version number as in the multitexture case if its later than 1.2.1 it must be there)

QMB Quake Engine - http://qmb.quakepit.com
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.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (33 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (40 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (37 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
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

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!