extensions

BlitzMax Forums/OpenGL Module/extensions

Bremer(Posted 2009) [#1]
Is there a way of getting the use of these opengl extension commands without having to import the entire glew module?

glGenFramebuffersEXT
glBindRenderbufferEXT
glRenderbufferStorageEXT


plash(Posted 2009) [#2]
Probably not.


ImaginaryHuman(Posted 2009) [#3]
Trying to save a few bytes?


Bremer(Posted 2009) [#4]
Yes I'm trying to get the size down on a program I'm working on.

In the thread about Deferred Renderer he has something like:

Extern "Win32"
Function wglGetProcAddress:Byte Ptr(lpszProc$z)
EndExtern

glGenProgramsARB           = wglGetProcAddress("glGenProgramsARB")


Because he said that he didn't want to import the entire glew module, but I just can't that to work. And since he doesn't use framework in his code, he is actually still importing the entire thing, which is why it works in his code.

So I'm thinking that maybe he did it wrong and there is a right way to do it, and that someone here might know, at least thats what I was hoping :)


plash(Posted 2009) [#5]
And since he doesn't use framework in his code, he is actually still importing the entire thing, which is why it works in his code.
That probably is what's happening.

Regarding your question.. There's really no easy way to do that (the entire glew code is what sets up extensions and constants, etc. and literally nothing is handled on the Max side - meaning you can't just strip out what you want).


kfprimm(Posted 2009) [#6]

Untested, but it should work. wglGetProcAddress may already be declared in PUB.OpenGL. If it isn't, add it to the source.

In this example, I've only included constants that relate to those three function. If you need to add more, the definitions for functions and constants are included in the registry.