Jump to content

  • Log In with Google      Sign In   
  • Create Account


GLUT to freeglut


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 gamepopper   Members   -  Reputation: 99

Like
0Likes
Like

Posted 04 May 2012 - 06:26 AM

So I'm currently working on a project in GLUT using Visual Studio 2010 C++. I want to make it run on freeglut because
1. From what I've read it's similar to GLUT
2. It's better because it's more updated to include features such as control of the main loop and closing windows.

So I download the package from TransmissionZero and add the correct header and dll files and changed my class definitions to include freeglut.h, assuming that freeglut will still process glut functions and variables.

Obviously I was assuming wrong because as soon as I made the switch, I get 500+ warnings and 10+ errors on my program when I try to build it. Every warning refers to a macro redefinition of GLUT specific variables (most of which aren't used in my program) and each error consist of
"'<glut function name>_ATEXIT_HACK' : redefinition, different linkage".

Switching the freeglut.h include back to glut.h loses all the errors and the program works normally.

So I'm aware that transferring from GLUT to freeglut isn't easy, but I can't find many tutorials specifically for freeglut and those I do find are similar to standard GLUT.

Is there anything I should check or do? I've tried both methods of including freeglut (both adding the file locations as additional include and link directories and by adding the files in the project's folder) and I get the same result.

Sponsor:

#2 DemonRad   Members   -  Reputation: 290

Like
1Likes
Like

Posted 04 May 2012 - 11:37 AM

freeglut is no longer the same library. You probably have to rewrite lot of code. In that case SDL should be a much better choice.

Peace and love, now I understand really what it means! Guardian Angels exist! Thanks!


#3 gamepopper   Members   -  Reputation: 99

Like
0Likes
Like

Posted 04 May 2012 - 12:12 PM

Ah I didn't notice that, I'll have a look at SDL then. Posted Image

#4 larspensjo   Members   -  Reputation: 1526

Like
0Likes
Like

Posted 04 May 2012 - 12:24 PM

I would recommend glfw. A minimal impact library replacing glut, creating an OpenGL context and managing input, and not much more. It is more modern.

SDL will also do that, as well as a lot of other things.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS