Recent Changes - Search:

Documentation

Help

Tutorials

RoadMap

Help Docs for wiki writers:

PmWiki

edit SideBar

FAQ /

CompilingSDLGFX

First let me say that I am in no way connected to the SDL_gfx team and I am not providing support for the SDL_gfx lib.
That being said it can be a real pain for beginners to get the SDL_gfx library to compile.
Since some version of my engine require this library's and I want beginner to be able to use my engine below are tutorials on how to compile SDL_GFX from source.
Note:
I am not going to provide binaries do to the amount of time it would take to keep them up to date.
First follow the Basic SetUp guide that matches your OS. You only need the SDL library(this will help with set up time).

SDL_GFX version SDL_gfx-2.0.16

Windows:

1)Download the SDL_gfx
2)Place the folder in the SDLProjects folder that you created from the Setup guide.
3)Open the Other Builds folder that is inside the SDL_gfx folder.
4)Select the zip file that best fits your compiler.
(Visual Studios 6 user, the way they want you to compile SDL_gfx is to complicated. I made a project for VS6 for you. Download these project files I made(SDL_gfxVS6.zip) instead and put them in the SDL_gfx folder)
5)Open the zip file and copy the file inside the extracted SDL_gfx folder 
6)Open the project you just copied from inside a new instance of your compiler. 
7)Once open remove any source files from the project.
8)Add the following files from the SDL_gfx folder:
SDL_rotozoom.h
SDL_framerate.h
SDL_gfxBlitFunc.h
SDL_gfxPrimitives.h
SDL_gfxPrimitives_font.h
SDL_imageFilter.h
SDL_framerate.c
SDL_gfxBlitFunc.c
SDL_gfxPrimitives.c
SDL_imageFilter.c
SDL_rotozoom.c
9)Highlight the sdlgfx project (Do not highlight any of the source files.) and then 
10)Setting up the compiler
DevCpp
Coming soon when I have time

Code::Blocks
Coming soon when I have time

Eclips
Coming soon when I have time

Visual Studios 6:
select the Project->Settings menu
under the C/C++ set the Category to Preprocessor in the Additional include directories add the following line with out the quotes. "../SDL/include/"
under the link  tab set the Category to Input in the Additional library path add the following line with out the quotes. "../SDL/lib/"
under the link set the Category to Input in the Object/library modules add the following line with out the quotes front of kernel32.lib (make sure there is space between it and the line you are adding). "SDLmain.lib sdl.lib"
Set the Settings For pull down menu to Release and follow the Visual Studios 6 step again.
Final (for Release mode only) under the C/C++ tab change the Category pull down menu to general
Then change the optimization pull down menu to Default.
Click ok

Visual Studios 2003 or above:
select the Project->Properties menu
under  C/C++->General->Additional Include Directories add the following line with out the qotes. "../SDL/include/"
under  Linker->General->Additional Library Directories add the following line with out the qotes. "../SDL/lib/"
under  Linker->Input->Additional Dependencies add the following line with out the quotes "SDLmain.lib sdl.lib"
now change the configuration to Release add the three lines again.
For Release only under C/C++->Optimization->Optimization change the pull down menu to Minimize Size(/01)
Click ok

11)add the following lines to SDL_gfxPrimitives.c some where above the aaellipseColor function
__inline long int
lrint (double flt)
{
	int intgr;
	_asm
	{
		fld flt
			fistp intgr
	} ;
	return intgr ;
}

__inline long int
lrintf (float flt)
{
	int intgr;
	_asm
	{
		fld flt
			fistp intgr
	} ;
	return intgr ;
}



now compile.

If you get errors check the FAQ section of this wiki for help.

You should now have a sdlgfx.dll and a sdlgfx.lib in a release or debug folder in the SDL_gfx folder.
You will need all the header files as well for what ever project you need sdl-gfx for.

Epee Engine users
Copy the sdlgfx.dll to your dll folder under sdl
Copy the sdlgfx.lib to you lib folder under sdl
and copy the following files to your include folder under the sdl folder
SDL_rotozoom.h
SDL_framerate.h
SDL_gfxBlitFunc.h
SDL_gfxPrimitives.h
SDL_gfxPrimitives_font.h
SDL_imageFilter.h

Mac:

coming soon

Linux:

For now follow the SDL_gfx teams instructions on there web site.

External Links For Compiling SDL_gfx

Visual Studios 2003

Edit - History - Print - Recent Changes - Search
Page last modified on June 19, 2008, at 03:13 PM