Why build from the source anyway?

Well, this is a good question. LOGL::GLib might not have exactly what you want,
but it might be a good base for you to branch off of. Since this is quite plausible,
it's really very nice to be able to change the source behind the library to suit the
game that you're creating.

How can I do it?

First, you'll need a copy of the source. The link to the latest source files is here:
Coincidentally, it's the same as the "Source Code" tab above this page.

Once you've the source extracted onto your computer, you'll need to open up
a project. If you're on a UNIX based system, this process will be different,
since you probably don't have Microsoft's Visual Studio installed. Just load up
all of the source/header files into the IDE of your choice and link to:

libGLEW.so, libGLU.so, and libGL.so

Note: If you're using Code::Blocks, you can skip this part by creating an SDL
project from the project menu. The only thing you'll need to do then is add the

Moving back to Windows, once a project is open (either Win32 or console),
you'll need to link to a few libraries.
openGL32.lib, glu32.lib, SDL.lib, and glew32.lib

Note: This assumes you have both GLEW and SDL installed.

It's generally a good rule to just build from the game template:

#ifdef __APPLE__
    #include <glew.h>
    #include <GL/glew.h>

#include "Game.h" /* Make sure that your project knows where Game.h is in the source. */

using namespace LOGL_GLib;
using namespace LOGL_GLib::Common;
using namespace LOGL_GLib::Input;
using namespace LOGL_GLib::Content;
using namespace LOGL_GLib::Math;
using namespace LOGL_GLib::Utilities;

class TestGame : public Game

	virtual GLvoid Initialize();
	virtual GLvoid LoadContent();
	virtual GLvoid Update();
	virtual GLvoid Draw();
	virtual GLvoid UnloadContent();


GLvoid TestGame::Initialize()

       /* Initialization code here... */

GLvoid TestGame::LoadContent()
       /* Load any content for your game here... */


GLvoid TestGame::Update()
	/* Check if we need to exit. */

        /* Update logic goes here... */


GLvoid TestGame::Draw()

        /* Draw code goes here... */


GLvoid TestGame::UnloadContent()
        /* Free up any indebted resources here... */


GLint main()
	TestGame myGame;

        return myGame.ExitCode;

Last edited Mar 5, 2011 at 8:18 AM by LorgonJortle, version 3


No comments yet.