Author Topic: How to use openGL on Codeblock ?  (Read 5257 times)

Offline WILL

  • Multiple posting newcomer
  • *
  • Posts: 25
How to use openGL on Codeblock ?
« on: March 13, 2008, 05:16:11 pm »
Just get installed, but I don't know how to add library for Codeblock. Any help would be appreciated !T_T ! Thanks !

Offline Kos

  • Single posting newcomer
  • *
  • Posts: 7
Re: How to use openGL on Codeblock ?
« Reply #1 on: March 23, 2008, 12:55:08 pm »
You don't install libraries for Code::Blocks, you install them for your compiler. The essential OpenGL libraries are usually served with the compiler, though.

As for adding libraries for C::B projects, try Project -> Build Options -> Linker Settings -> Link libraries.

Offline indigo0086

  • Almost regular
  • **
  • Posts: 150
Re: How to use openGL on Codeblock ?
« Reply #2 on: March 24, 2008, 02:17:15 pm »
What I recommend is using a simple framework such as GLFW, this allows you to create a window for OpenGL drawing without using win32 routines.

After you compile it simply use the Codeblocks Library finder plugin and point it to the base directory for GLFW, then it will add the environment variables automatically so you don't have to hard-wire the absolute path.

When that is all said and done, simply go to New->Project->GLFW Project and it will load all the library and path settings.

As for OpenGL itself, the libraries are included with the compiler like Kos said.  They are Opengl32.a/lib and the include file is <GL/gl.h>

« Last Edit: March 24, 2008, 02:23:52 pm by indigo0086 »