views:

230

answers:

1

I want to add a GLSL fragment shader to a program of mine, however I have been unable to find comprehensive documentation related to the C language (not C++ or C#). Anyone has examples or steps to get the ARB extension for shaders, or some sort of "hello world" template? I don't need help on the shaders themselves, just how to get them running into a C program, and more specifically on the commands required.

+2  A: 

This is the tutorial I learned shaders from. If I recall, the tutorial is C friendly. It covers both ARB and OpenGL 2.0 function methods.

GMan
I know of that one, but seems to use GLUT...I am using SDL myself. Will it still work?
Dubidubinya
It uses straight-up OpenGL functions, defined in your OS's respective OpenGL include files. (Like `#include <GL/gl.h>, #include <GL/glu.h>`)
GMan
So I can safely ignore all glut-related things? Excuse the newbieness on the question but I never used GLUT so not sure what to expect.
Dubidubinya
Yup, GLUT is pretty much yet-another-wrapper around OpenGL. No problems about the questions, if you hit a snag leave a comment here and I'll see it.
GMan
I see, thank you very much! Knowing that I managed to get it progressing.
Dubidubinya