SDL Please???

Started by
13 comments, last by DeadXorAlive 18 years, 1 month ago
I can't seem to get my hands on SDL for Dev-C++... AND I AM NOT DOWNLOADING ANOTHER ******* COMPILER WITH MY ******* 56K DIALUP!!!! That is all, thank you.
------------------------------I just learned to speak CounterStrike! "W00t I own this map!I m lik a l33t h4x0r or sumthing n0 0ne can 0wn up to my r0x0r skillz!"
Advertisement
Also, just avoiding making another thread...

How do you change that little icon in the upper left corner of the window?
The icon it's giving me is ugly.
------------------------------I just learned to speak CounterStrike! "W00t I own this map!I m lik a l33t h4x0r or sumthing n0 0ne can 0wn up to my r0x0r skillz!"
You set your program's icon when you create your windows class.

WNDCLASSEX wc;
wc.Icon = LoadIcon(NULL, IDI_EXCLAMATION);
wc.IconSm = LoadIcon(NULL, IDI_EXCLAMATION);

The Icon is the one you see for the executable of your program and the IconSm is the one in the upper left corner. I have been using IDI_EXCLAMATION up until now. Now I'm trying to use a custom one, and I can get the Icon to work but not the IconSm... To use a custom icon, assuming your compiler is like mine, click Insert->Resource->Icon. Then LoadIcon(NULL, IDI_WHATEVERYOUNAMEDIT).
You shouldn't need a version specific for Dev-C++. Just download the SDL Win32 SDK and learn how to link with it with Dev-C++.
Free Mac Mini (I know, I'm a tool)
Download SDL (if you have not already done so), from here (SDL for windows).

Extract it, and go to your dev-cpp folder.

Copy the contents of ...\SDL-1.2.9\include

to C:\folder1\folder2\dev-cpp\include.

copy the contents of ...\SDL-1.2.9\lib

to C:\folder1\folder2\dev-cpp\lib.

Open dev-cpp, make a new project. Make it a windows project. Get rid of whatever code you get by default, and paste this in:

#include "SDL.h"int main( int argc, char **argv ){   SDL_Init( SDL_INIT_VIDEO );   SDL_Surface *screen = SDL_SetVideoMode(300,300,32,SDL_SWSURFACE);   SDL_Event event;   bool done = false;   while(!done)   {     while( SDL_PollEvent( &event ) )     {         if( event.type == SDL_QUIT )            done = true;     }   }   SDL_Quit();   return 0;}


Go to project->project options->parameters and add this to "linker options"
Quote:
-lmingw32 -lSDLmain -lSDL


Save, compile and run. If it doesnt work, post the errors you get.

Edit: link fixed
ripoff, that's only the DLL.

And I should be able to get th Vc++ package to work with my IDE, right?
------------------------------I just learned to speak CounterStrike! "W00t I own this map!I m lik a l33t h4x0r or sumthing n0 0ne can 0wn up to my r0x0r skillz!"
Dev-C++ has Dev-Paks that install libraries for you. It has one for SDL, too. Go to tools->updates/packages->devpaks.org for the server->check for updates->select SDL and any other libraries you want->download selection

The rest is easy to figure out. Then just create a new SDL project and it should work.
Quote:Original post by BASICisforsquares
ripoff, that's only the DLL.

And I should be able to get th Vc++ package to work with my IDE, right?


Whoops, you're right. This is what you want. (Dev-cpp uses mingw, so it should work). Its what I used if I remember correctly.

About the Vc++ package I don't know.
Quote:Original post by Ezbez
Dev-C++ has Dev-Paks that install libraries for you. It has one for SDL, too. Go to tools->updates/packages->devpaks.org for the server->check for updates->select SDL and any other libraries you want->download selection

The rest is easy to figure out. Then just create a new SDL project and it should work.


The dev-packs are at version 1.2.4 though.

If you decide to do it this way, at least replace SDL.dll with a newer one.
Quote:Original post by BASICisforsquares
ripoff, that's only the DLL.

And I should be able to get th Vc++ package to work with my IDE, right?


I guess not - I might be wrong, but I believe that the library format is different (.lib != .a)

Regards,

This topic is closed to new replies.

Advertisement