Desperate help with OpenGL?

Right, I've been programming C++ for a while now, but I got pretty bored with the command line interface and wanted to start learning some computer graphics. I did some Google searches and found out that I'd need an external library, and some more searches brought me to OpenGL.

Since then, it's been hell trying to actually use OpenGL. I have two IDEs on my computer - CodeBlocks and Visual Studio 2010 (I usually use the latter). I have not been able to find one single website that offers a step-by-step guide on how to use OpenGL, and I've followed tons of Googled tips, some contradictory, all confusing.

Basically, I've learned that I need to download libraries, and then include them in CodeBlocks and Visual Studio 2010 include and lib folders, and something about .dlls in System32.. I've followed all instructions, yet when I try to run the sample code from the websites, they didn't work..

What I'd appreciate is a step-by-step guide (Write it as if speaking to an idiot :)) on how to download whatever libraries I need, where to put them, and how to properly configure the IDE to run a sample code (I'd also appreciate it if someone would provide the sample code, :P)..

Thanks in advance.
Last edited on
EDIT: I for got to say before you switch to graphisc programming make sure you understand stuff like pointers, classes, inheritance, polymorphsm, stuff like that. Other wise you'll be lost.


If i were you ( and i was in your exact position before lol ) I would learn a 2D graphics library to ease the change from console to graphics progamming. I learned SDL but i would suggest you learn SFML which is pretty much a more modern version of SDL. The reason i didn't learn it is because it was too confusing to set up but i think i code blocks its easy to do.


You could also go with allegro but i hear that doesnt work with OpenGL as well as SDL or SFML.
Last edited on
Last edited on
Nano, thanks for the help, but I was also unable to get SFML to work on CodeBlocks (Or SDL, for that matter). And Catfish, Nehe was one of the websites I visited while trying to get OpenGL to work, but like I said in the first post, no matter what advice I followed, I was unable to get it running.

I followed all the instructions given at http://www.sfml-dev.org/tutorials/1.6/start-cb.php, but when I tried to run the code they supplied me with:

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <SFML/System.hpp>
#include <iostream>
int main()
{
    sf::Clock Clock;
    while (Clock.GetElapsedTime() < 5.f)
    {
        std::cout << Clock.GetElapsedTime() << std::endl;
        sf::Sleep(0.5f);
    }

    return 0;
}


I got the following error messages:

Project : Win32 Application
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Users\owner\Documents\Programming\
--------------------------------------------------------------------------------
Switching to target: default
Compiling: main.cpp
Linking executable: C:\Users\owner\Documents\Programming\testing1.exe
.objs\main.o:main.cpp:(.text+0x210): undefined reference to `sf::VideoMode::VideoMode(unsigned int, unsigned int, unsigned int)'
.objs\main.o:main.cpp:(.text+0x258): undefined reference to `sf::Window::Window(sf::VideoMode, std::string const&, unsigned long, sf::WindowSettings const&)'
.objs\main.o:main.cpp:(.text+0x31a): undefined reference to `sf::Window::Display()'
.objs\main.o:main.cpp:(.text+0x334): undefined reference to `sf::Window::~Window()'
.objs\main.o:main.cpp:(.text+0x399): undefined reference to `sf::Window::~Window()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
Last edited on
idk about SFML but i could help you set up SDL if your still up for it. send me a pm if you do.
You are not linking it or setting up correctly in your IDE - SDL's Lazyfoo's site has VERY detailed instructions on how to do that. SFML Also has pretty detailed instructions on 1.6 but youll need to watch SFMLCoders youtube videos to set up SFML 2.0. But you have to set everything up very carefully read the whole guide twice it can be a pain in the ass
Nano, I would have sent you a PM but your profile says "This user does not accept private messages" :P. I would like help setting it up, though..
EDIT: You do not accept them either lol. Click user cp at the topright to change it

lol Sorry about that! Ill send you a pm to tell you how to set it up

Last edited on
Topic archived. No new replies allowed.