Advertisement

Should I use main() or WinMain() ?

Started by June 30, 2001 10:49 AM
10 comments, last by stefu 23 years, 7 months ago
To get ontopic again:

You can also use WinMain AND main

  int main(int argc, char** argv){  // Blah  // ...  return 0;}#if defined(_WIN32)int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)  return main( __argc, __argv );}#endif  


You can also set the entry point symbol (menu Settings -> Link -> Output -> Entry-point symbol) of your program (windows version) to "mainCRTStartup" wich calls main instead of WinMain...
Until about a week ago it was pretty hard to write a cross-platform app that used a GUI. However, Trolltech (www.trolltech.com) have just released their QT cross-platform GUI library for free under windows (it had been free under linux for a while). It compiles under Win32, Linux, Mac OSX, and (I think) BeOS, with NO changes. As far as other cross-platform stuff. I''d go with the SDL (www.libsdl.org) to 2d and image surface stuff, and (of course) OpenGL and GLUT for the 3d stuff.

In summary:
1.) QT (www.trolltech.com) (This thing is Friggin'' Awesome! Check it out!)

2.) SDL (www.libsdl.org) (This also has some simple gross platform GUI libs written on top of it, so you might be able to use those too).

3.) OpenGL (www.opengl.org)

This topic is closed to new replies.

Advertisement