PDA

View Full Version : Starting openGL



C++buntu
July 20th, 2009, 02:51 AM
Hi everyone,

I want to start using openGL for some graphics programming with C++ but i have no clue of what i need to download in order to be ready.
I have a NVIDIA Quadro NVS 120M with 512 Megs. I don't even know if my video card can support this API...Do i need to download the NVIDIA specific openGL kit or some other?

Thanks for advice

efikkan
July 20th, 2009, 03:45 AM
Your gpu seems to be OpenGL 2.x/DirectX 9.0c/Shader Model 3 -class (comparable to the GeForce 7xxx-series), after a quick search. It would certainly support hardware acceleration of OpenGL if you got the proper drivers (I recommend the proprietary nVidia-drivers if you run GNU/Linux). This is not a high-end graphics card, but it will perform ok for testing purposes.


I suggest you follow NeHe's OpenGL tutorials for learning OpenGL basics: http://nehe.gamedev.net/
These tutorials cover the basics of OpenGL and more, but not a lot of shading.

You'll quickly notice there are different ways of setting up a window with an OpenGL rendering context. You could do it the hard way (doing calls to xorg or win32, etc.) or use a library like SDL or GLUT, both platform independent. Since GLUT is both outdated, restricted and buggy, I would strongly recommend SDL for those learning OpenGL, since GLUT is unusable in most cases, and writing your own loader requires som experience. Choose SDL for now. A lot of tutorials tends to use GLUT or their own implementation. (I prefer my own implementation, but I like to do things my own way :) )


Both nVidia and AMD/ATI got OpenGL SDK with demos and documentation. In addition, nVidia got cg shading, their own shading language, wich can be converted to both GLSL and HLSL. (since AMD/ATI don't support cg) Both nVidia and AMD/ATI got tools for designing shaders. Most demos will run on both nVidia and ATI cards, except demos using cg and/or special extensions. A new driver might help.


Notice: this post is written in the middle of the night, so it might contain serious spelling errors. :)


Wich compiler do you use?

C++buntu
July 20th, 2009, 04:02 AM
Your gpu seems to be OpenGL 2.x/DirectX 9.0c/Shader Model 3 -class (comparable to the GeForce 7xxx-series), after a quick search. It would certainly support hardware acceleration of OpenGL if you got the proper drivers (I recommend the proprietary nVidia-drivers if you run GNU/Linux). This is not a high-end graphics card, but it will perform ok for testing purposes.


I suggest you follow NeHe's OpenGL tutorials for learning OpenGL basics: http://nehe.gamedev.net/
These tutorials cover the basics of OpenGL and more, but not a lot of shading.

You'll quickly notice there are different ways of setting up a window with an OpenGL rendering context. You could do it the hard way (doing calls to xorg or win32, etc.) or use a library like SDL or GLUT, both platform independent. Since GLUT is both outdated, restricted and buggy, I would strongly recommend SDL for those learning OpenGL, since GLUT is unusable in most cases, and writing your own loader requires som experience. Choose SDL for now. A lot of tutorials tends to use GLUT or their own implementation. (I prefer my own implementation, but I like to do things my own way :) )


Both nVidia and AMD/ATI got OpenGL SDK with demos and documentation. In addition, nVidia got cg shading, their own shading language, wich can be converted to both GLSL and HLSL. (since AMD/ATI don't support cg) Both nVidia and AMD/ATI got tools for designing shaders. Most demos will run on both nVidia and ATI cards, except demos using cg and/or special extensions. A new driver might help.


Notice: this post is written in the middle of the night, so it might contain serious spelling errors. :)


Wich compiler do you use?

I'm using g++ on Linux but i would try openGL on Windows too, perhaps with Microsoft Visual Studio 2008 if i can...

If i download the latest openGL kit from NVIDIA, will my video card be ok or i should use the 2.x versions?

Thanks for your advice!

abhilashm86
July 20th, 2009, 05:13 AM
for opengl, u need to install freeglut libraries, type following in terminal,


sudo apt-get install freeglut3 freeglut3-dev

then,
use g++ compiler......


g++ -lGL -lglut test1.cpp -o test1

__________________

Sockerdrickan
July 20th, 2009, 06:53 AM
Actually


g++ test1.cpp -o test1 -lGL -lglut
makes more sense to me :P

nrs
July 20th, 2009, 07:02 AM
for opengl, u need to install freeglut libraries, type following in terminal,


sudo apt-get install freeglut3 freeglut3-devthen,
use g++ compiler......


g++ -lGL -lglut test1.cpp -o test1__________________
Incorrect. He only needs to install the freeglut libraries if he intends to use freeglut. Your video driver will provide the library, libglu1-mesa-dev will provide all relevant headers.

build-essential if you don't already have it.
Proprietary nVidia driver.
libglu1-mesa-dev.

that's it.

C++buntu
July 20th, 2009, 02:03 PM
A big thanks for all of us! It's good to know that there are helping people in the Linux community!

Sockerdrickan
July 20th, 2009, 03:21 PM
Incorrect. He only needs to install the freeglut libraries if he intends to use freeglut. Your video driver will provide the library, libglu1-mesa-dev will provide all relevant headers.

build-essential if you don't already have it.
Proprietary nVidia driver.
libglu1-mesa-dev.

that's it.
The proprietary nvidia driver brings headers.

efikkan
July 20th, 2009, 05:53 PM
If i download the latest openGL kit from NVIDIA, will my video card be ok or i should use the 2.x versions?

Thanks for your advice!

The latest SDK is nVidia OpenGL SDK 10.5 (http://developer.download.nvidia.com/SDK/10.5/opengl/samples.html).
As you can see, some of these demos require GeForce 8 (wich is OpenGL 3.x/DirectX 10.x class), but none of these demos require OpenGL 3.x, but some might require extensions wich your gpu does not support. Just test it out, some might work. If not, you'll get an error message displaying wich extensions your gpu lacks support for.

Check out the 9.5 SDK as well (http://developer.download.nvidia.com/SDK/9.5/Samples/samples.html), and the cool nature scene demo (http://developer.nvidia.com/object/nature_scene.html)

nrs
July 20th, 2009, 10:57 PM
The proprietary nvidia driver brings headers.
Heh. You have to install nvidia-glx-WHICHEVERVERSION-dev separately. I knew the proper came with headers, always assumed Ubuntu just went with MESA's. Well, I'm wrong too then. Though you still can use MESA's. I doubt most people would notice unless using a lot of proprietary extensions.

abhilashm86
July 21st, 2009, 04:17 AM
Incorrect. He only needs to install the freeglut libraries if he intends to use freeglut. Your video driver will provide the library, libglu1-mesa-dev will provide all relevant headers.

build-essential if you don't already have it.
Proprietary nVidia driver.
libglu1-mesa-dev.

that's it.

we need not install drivers, if NVIDIA, my computer just asked about installing driver, i made it, note that this video drivers wont provide headers in default, we need to install.........

Sockerdrickan
July 21st, 2009, 07:04 AM
Heh. You have to install nvidia-glx-WHICHEVERVERSION-dev separately. I knew the proper came with headers, always assumed Ubuntu just went with MESA's. Well, I'm wrong too then. Though you still can use MESA's. I doubt most people would notice unless using a lot of proprietary extensions.
I use OpenGL 3.1 so I have to fetch this either way http://www.opengl.org/registry/api/gl3.h :popcorn: