Where do I even download it...?

Well, LOGL::GLib releases are downloadable from the "Downloads" tab.
Alternatively, here's a link: http://loglglib.codeplex.com/releases Cheers.

Alright, now how do I link to it?

Linking to LOGL::GLib is simple. You just need to tell your IDE/compiler where to find
the *.lib file, and the header file. Generally speaking, it's a good idea to keep these files
right in your project's directory, along with your own source code. This is an especially
good idea since LOGL::GLib is evolving so much so quickly in its early phases.

Ok, so... how about a step-by-step explanation?

Sure! I'll give you a step-by-step explanation for the setup.

Windows (Visual Studio):

Create a new project

You have a choice here to create a Console or normal Win32 project.
A Console application will show a black console window behind your game.
This is great for debugging, as you can easily write to the standard output,
but it might not be ideal for releasing. There's a simple way you can hide the console,
but it's still visible for a bit. Because of this, you may want to create a normal Win32 project.

In either case, make sure you check the Empty Project option, as we don't want any weird code
thrown into our game.
If creating a Console project:
You may want to hide the console at any point in time. The following line of code will do such a thing:

ShowWindow(GetConsoleWindow(), SW_HIDE);
If creating a normal Win32 project:
Since LOGL::GLib requires the standard main declaration and not WinMain, you'll need to change the entry
point of your project. In Microsoft's Visual Studio 2010, it's here (shouldn't be too different with earlier versions):

Project Properties->Linker->Advanced->Entry Point

You'll need to set this value to mainCRTStartup.
Refer to this link for more explanation; http://msdn.microsoft.com/en-us/library/f9t8842e.aspx

Make sure the project can find the LOGL::GLib libraries and header file

Once your project is created, the first thing you should do is make sure that you've copied the header file
and the library files into your project's source directory. If you don't do this... there's no point in even
trying to use LOGL::GLib!

After those are in place, you'll need to link/include them. In the Project Properties, go to Linker, and Input. Add:

LOGL_GLib_Debug.lib;

To the Debug configuration's dependencies. And add:

LOGL_GLib_Release.lib;

To the Release configuration's dependencies. Make sure not to put any spaces in, and to end it with a semicolon.

Linux (Code::Blocks):

Create a new SDL project:

If SDL is installed, you can very easily create a new SDL project in Code::Blocks and it will have
everything set up for you. For GLEW, you may need to add -lGLEW to your linker settings. After
that, just link to whichever LOGL::GLib library you have (get the latest!) and you should be good
to go.

To link to LOGL::GLib, add:

LOGL_GLib_Debug.a

To the Debug configuration's dependencies. And add:

LOGL_GLib_Release.a

To the Release configuration's dependencies

The project has now been setup! The only thing left to do is get some code going.

Build your game from the template:

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

#include "LOGL_GLib.h"

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
{
public:
	TestGame();

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

TestGame::TestGame()
{
}

GLvoid TestGame::Initialize()
{
	Game::Initialize();

       /* Initialization code here... */
}

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

       Game::LoadContent();
}

GLvoid TestGame::Update()
{
	/* Check if we need to exit. */
	if(Keyboard::IsKeyDown(Key_Escape))
		Exit();

        /* Update logic goes here... */

	Game::Update();
}

GLvoid TestGame::Draw()
{
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

        /* Draw code goes here... */

	Game::Draw();
}

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

        Game::UnloadContent();
}

GLint main()
{
	TestGame myGame;
	myGame.Run();

        return myGame.ExitCode;
}

Last edited Mar 6, 2011 at 4:22 AM by LorgonJortle, version 8

Comments

No comments yet.