PDA

View Full Version : How to use extensions?



Ahmed Fouad
05-22-2008, 04:35 AM
Hi all,
I'm new to using extensions with OpenGL.
Can anyone explain to me how to use an existing extension?
Perhaps you could use the GL_EXT_texture_compression_s3tc extension as en example since I need to use it.
Note: The device I'm developing for supports this extension

Thanks.

V-man
05-22-2008, 07:08 AM
This is explained in the Wiki, Getting Started
http://www.opengl.org/wiki/index.php/Main_Page

If it's not clear, ask questions then.

greg2
05-22-2008, 08:22 AM
Hi,

Tutorial:
http://www.gamedev.net/reference/articles/article1929.asp

Library to make life easier:
http://elf-stone.com/glee.php

RGHP
05-22-2008, 08:34 PM
Use GLEW!
http://glew.sourceforge.net/

from there:


You have access to all OpenGL functions and extensions in the linking part of your program. You only need to call glewInit() after creating the OpenGL context, and before use extensions call you need to check :

if (GLEW_ARB_vertex_program)
{
/* It is safe to use the ARB_vertex_program extension here. */
glGenProgramsARB(...);
}


or
[/CODE]
if (glewIsSupported("GL_VERSION_1_4 GL_ARB_point_sprite"))
{
/* Great, we have OpenGL 1.4 + point sprites. */
}
[CODE]

You can mix it and is better than other APIs like Windows GL or SDL. Here is an example with FBOs:

http://www.4shared.com/file/48608152/6709f644/SDL_GLExtensions.html

Is an EclipseProject, you need SDL libs for run it, but you can check the source code. I don't make use of glewIsExtensionAvailable() beacuse I already know my card supports it, but you should add inside the method 'initializeGL()'

Bye!
http://www.raul-art.blogspot.com