Does anyone have 64-bit SDL 2 working with 64-bit Pelles C? I can't seem to compile/link an sdl2main.lib, which is needed to do some initialization before calling main(). I would be most grateful if someone could post the file here. Maybe you called it sdlmainlib, that's fine, as long is it's 64-bit.
Thanks
Alan
SDL 2 don't need that if use#define SDL_MAIN_HANDLED
#include "SDL.h"
...
/* Initialize SDL */
#ifdef SDL_MAIN_HANDLED
SDL_SetMainReady(); // only when using SDL_MAIN_HANDLED
#endif
...
// SDL_MainW.c
int __cdecl main(int argc, char* argv[]);
#ifdef __POCC__
extern int __argc;
extern char **__argv;
#endif
int __stdcall WinMain(int hInstance, int hPrevInstance, char* lpszCmdLine, int nCmdShow)
{
return main(__argc, __argv);
}
TimoVJL,
I didn't know about SDL_MAIN_HANDLED! That worked. Thanks! :)
A couple of things to remember, when using the command line for 64-bit stuff: polib needs the option -machine:x64, however, polink doesn't seem to need it. Also, cc and pocc need the option -Tx64-coff.
Alan