Jump to content
  • Advertisement
Sign in to follow this  
arithma

OpenGL A bunch of beginner questions

This topic is 2999 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So I'm new to the OpenGL world. I recently made an OpenGL ES 2.0 demo that worked on the now discontinued AMD emulator.
I ported it into OpenGL, and all shit ensued upon me.

The demo can be found here: download.

Questions follow:
- I am using freeglut + glew. The dlls are being packaged with the application. Is that the way to go?

- I wrote a shader that worked top notch for the OGLES demo. After I updated my graphics driver (now on [OGL 3.3] and [GLSL 3.3]), everything works fine. I can't test what happens when I have earlier versions of OGL and company. Is there a way to run an application in an earlier context for testing?

- On some machines, the shaders got compiling without a glitch, on others it spit out all sort of monstrous compiling errors. How can I make sure that the target platform matches the requirements? What can I do to make sure that the shaders I write are restricted to a certain language version?

- Is it possible, while although I put the line: #version 110 in the vertex and fragment shaders, that the compilation will still go wrong (though it ran well on my own machine)?

Share this post


Link to post
Share on other sites
Advertisement
Disclaimer: I am by no means an OpenGL expert, shader programmer, or actually know anything about shaders, but I thought I'd reply anyway.

Quote:
- I am using freeglut + glew. The dlls are being packaged with the application. Is that the way to go?

Yes. You can either have them in the same directory as your applications binary, or somewhere else in the systems path (e.g. C:\Windows\System32).

Quote:
- I wrote a shader that worked top notch for the OGLES demo. After I updated my graphics driver (now on [OGL 3.3] and [GLSL 3.3]), everything works fine. I can't test what happens when I have earlier versions of OGL and company. Is there a way to run an application in an earlier context for testing?

I believe creating a context for OpenGL 3.0 and later is different from creating a context for older OpenGL versions. This may or may not be true. This page (which another user of this site posted in another thread) seems to show how to create a OpenGL 3.x context, although I havn't tried it (I have a GeForce 6 lol). I am unsure if that will actually aid in testing on different levels or hardware though.

Quote:
- On some machines, the shaders got compiling without a glitch, on others it spit out all sort of monstrous compiling errors. How can I make sure that the target platform matches the requirements? What can I do to make sure that the shaders I write are restricted to a certain language version?

This page on the OpenGL site shows how to find the shader version supported by the hardware you are running on. I guess you could then test it is at least the required version and either continue running or bail with some sort of error message as required. When writing your shaders, restrict yourself to features only available in the lowest version you want to target, or write several versions for different shader model versions that support different features.

Quote:
- Is it possible, while although I put the line: #version 110 in the vertex and fragment shaders, that the compilation will still go wrong (though it ran well on my own machine)?

I have no idea sorry. I ran your program from the link posted, and it said my GL version was 2.1, and my GLSL version was 1.20. It then proceeded to print out a constant stream of 0's. The program appears to work though, except the lighting looks kinda funky. Here is a screenshot of what it looks like run on my hardware (Win 7, GeForce 6600, GL 2.1, GLSL 1.20).

Well I hope this was a least somewhat helpful :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!