Without GLEW

Hi guys…

I’m new to shaders and need your help.

I’m trying to write a program including shaders without using glew. How can I do that?

Currently I’m using DevC++.

Thank you.

What’s the reason NOT to use GLEW? That’s like asking how to use the highway without a car.

Anyway, check out nehe.gamedev.net there is a tutorial to get you started with extensions the “old fashioned” way - if you really want to.

Jan.

It’s one external dependency less. I don’t see any reason why I should use GLEW, it’s really a trivial library that just adds to my dependencies.

It’s not really a problem to load extensions. Basically you need something like the following code for each function:

Header file ext.h:

#include <GL/gl.h>
#include <GL/glext.h>

#define glShaderSource __extproc_glShaderSource

extern PFNGLSHADERSOURCEPROC glShaderSource;

C file:

#include "ext.h"

PFNGLSHADERSOURCEPROC glShaderSource;

void load() {
    glShaderSource = glxGetProcAddressARB("glShaderSource");
}

That’s all easily generated out of glext.h with a simple awk script or something similar. So the only real coding I have to do is checking the version and extension string.

Of course, for small demos that’s all overkill. There I would just use GLEW, SDL and so on for all the low level code.

Thank you…

Yes. No doubt. Using GLEW is easier.

The purpose for me not using GLEW is to learn explore more about shaders, extension and hardware caps programming.

I’ll google on the hint given.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.