Author Topic: SDL OpenGL Set up in windows  (Read 12102 times)

Offline slanker70

  • Single posting newcomer
  • *
  • Posts: 6
SDL OpenGL Set up in windows
« on: April 22, 2009, 09:11:28 pm »
First of all this is my first ever post in the forums so hi all,

I'm trying to develop a cross platform game engine with OpenGL and SDL using code::blocks as the IDE.

At the moment I'm having difficulties setting it up in windows, the only tutorials that actually work when I tried it was the one from NeHe

http://nehe.gamedev.net/wiki/(S(hop05t45mflkcmeouxiojbra))/Default.aspx?Page=LessonCodeBlocksWin&AspxAutoDetectCookieSupport=1

But it doesn't explain how to set it up from scratch (it uses a pre-build code::blocks project) or using the new project->SDL application wizard.

I also couldn't find any tutorial on how to set it up in OS X(SDL OpenGL).

Finally I tried to port my existing project from Visual Studio to code::blocks in Linux but kept getting this error message

Quote
error: ‘<anonymous>’ has incomplete type
error: invalid use of ‘GLvoid’

 It seems that for some reason the code::blocks doesn't allowed specifying GLvoid in the functions parameter

Code
// This class handles SDL and OpenGL initialisation
class EngineCore
{
public:

// Class constructor and destructor
EngineCore(GLvoid);  <----------------------------- like this for example
~EngineCore(GLvoid);

public:

// Class member function

// Initialise EngineCore
GLvoid initialise(GLsizei in_width, GLsizei in_height);
// Initialise SDL
GLvoid initSDL(GLvoid);
// Initialise SDL window
GLvoid intitSDLwindow(GLvoid);
// Initialise OpenGL
GLvoid initGL(GLvoid);
// Set up OpenGL view port for 3D viewing since the default view in OpenGL is an orthographic view
GLvoid set3DView(GLvoid);

private:

// Class data memebers
GLsizei width, height;
};

Is this a standard thing in code::blocks

Please help me solved this issues.

Many thanks,

Perdana Putra

Online stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: SDL OpenGL Set up in windows
« Reply #1 on: April 22, 2009, 09:19:13 pm »
Code::Blocks is an IDE.
It is NOT an compiler.

The compiler you are using is raising the error!!

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline slanker70

  • Single posting newcomer
  • *
  • Posts: 6
Re: SDL OpenGL Set up in windows
« Reply #2 on: April 22, 2009, 09:27:08 pm »
Hi Tim,

I do know that code::blocks is not a compiler rather an IDE, and I did mention it in my first post!!

Quote
I'm trying to develop a cross platform game engine with OpenGL and SDL using code::blocks as the IDE.

I'm merely asking whether anyone have a smiliar problem using code::blocks with GNU CC as the compiler. You got an answer for this problem?

Regards,

Perdana Putra

Online stahta01

  • Lives here!
  • ****
  • Posts: 7790
    • My Best Post
Re: SDL OpenGL Set up in windows
« Reply #3 on: April 23, 2009, 12:08:45 am »
I suggest using an compiler known to compiler the code; or submitting bug reports to get the code to work.

GCC has trouble with anonymous namespaces. Not sure if it is just MinGW 4.x only.

Tim S
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline slanker70

  • Single posting newcomer
  • *
  • Posts: 6
Re: SDL OpenGL Set up in windows
« Reply #4 on: April 23, 2009, 12:13:43 am »
Hi Tim.

Many thanks for the reply, wil surely do that.

Any ideas on set up tutorials for windows and OS X though?

Regards,

Perdana Putra