2D fragment shader in C , where do I start?

I’d like to make an application displaying a fragment shader in C,
with the abillity to set the uniforms of the shader.

I have written 2D fragment shaders on editor.thebookofshaders.com ,
but only written tiny console applications in C.

What library and boilerplate would be a good place to start?
glfw or something else?

GLUT or GLFW either one. Either saves you needless wasting time just getting a window opened and a GL context created and active using platform-specific APIs, and also gives you some measure of cross-platform support.

[QUOTE=prince_polka;1289684]I’d like to make an application displaying a fragment shader in C,
with the abillity to set the uniforms of the shader.[/QUOTE]
If you want a UI which allows the user to enter numbers via text fields or sliders, GLUT/GLFW don’t have direct support for that.

If you’re using C, I’d suggest using GTK. Most of the other popular GUI toolkits are C++. Either way, you’re going to need to learn GUI programming concepts.

[QUOTE=GClements;1289691]If you want a UI which allows the user to enter numbers via text fields or sliders, GLUT/GLFW don’t have direct support for that.

If you’re using C, I’d suggest using GTK. Most of the other popular GUI toolkits are C++. Either way, you’re going to need to learn GUI programming concepts.[/QUOTE]

I don’t need textfields or sliders, just a window displaying the shader, to set the uniform I wan’t something like glUniformX()

I installed glfw, creating a window works, but most functions creates errors.


puts(glGetString(GL_VERSION)); // 4.5.13469 Compatibility Profile Context 21.19.525.0
glCreateShader() //undefined reference
glGetUniformLocation(,"") //undefined reference

[QUOTE=prince_polka;1289861]I don’t need textfields or sliders, just a window displaying the shader, to set the uniform I wan’t something like glUniformX()

I installed glfw, creating a window works, but most functions creates errors.


puts(glGetString(GL_VERSION)); // 4.5.13469 Compatibility Profile Context 21.19.525.0
glCreateShader() //undefined reference
glGetUniformLocation(,"") //undefined reference

[/QUOTE]

You also need glew.

It installed glew and it did not work, then i put -lglew32 in compiler options and now it works.
Setting a uniform and drawing a shader with the uniform works now, I will probably run into more problems but now I have something to start with!