< Back to main page

SoGlut and SoSDL RenderArea

SoSDLRenderArea linking problems on Windows: If you see linking errors like "msvcrt.lib(MSVCRT.dll) : error LNK2005: _exit already defined in LIBC.lib(crt0dat.obj)" in MS Visual C++, you need to change type of run-time library for your project. Go to Project > Settings > C/C++ > Category: Code Generation and set Use run-time library to "Multithreaded DLL". The reason is, that SDL library is linked as "Multithreaded DLL" and it is problem to have two types of run-time library in one application. So, another solution is to relink SDL with run-time library you are using is your project.

Multiple render area troubles: During the developement I have noticed many problems with this. GLUT looks very buggy on some platforms when we are using multiple windows (this does not include Windows) and current implementation of SDL (1.2.3) do not support more windows at a time.

How to survive with SDL: Multiple render areas are supported but only one can be visible on the screen at a time, the rest must be hidden. So it is possible, for example, to show splash screen during an application start-up, then hide it and show main application window. No platform dependent problems are known.

How to survive with GLUT: On Windows you can use multiple render areas on GLUT version at least 3.7.6. On my Linux it works well (GLUT version 3.7.0). On MacOS X it is impossible to have multiple windows because of uncomplete GLUT multiple windows support implementation. You should expect some problems like keyboard and mouse input going to a wrong window, or the rendering happens on a wrong window and so on. Other platforms are untested.

Fullscreen troubles: It completely works on Windows platform. On Linux fullscreen works completely right only with SDL. GLUT works but you can not change screen resolution (incomplete GLUT implementation). It is same with Mac OS X GLUT. SDL on Macs works well except detecting of supported resolutions (SDL support lack).

Window close problems: When user close any of GLUT windows (Windows and Linux tested), application is terminated. I do not find any way to go around this. Probably, only solution is that somebody puts a little bit time to extend GLUT library to handle windows closing in some better way. GLUT also gives no way to register close callbacks. SDL makes no problem with all this. Simply, if you do not register window close callback and windows is closed, application is terminated. If windows close callback is registered, user is responsible for an apropriate action.

atexit functions are not called: This is a Microsoft DLL related problem. One solution is to upgrade to the latest version of GLUT that contains special hack to handle this. Another solution, or if you are using SDL, is to relink your application with the MSVCRT.LIB (multi-threaded, DLL) library, the one GLUT and SDL is linked against. If you are using Visual C, go to Project > Settings > C/C++ > category Code Generation and set Use run-time library to Multithreaded DLL.


main page      download page      FAQ page


This page is maintained by PC John (peciva@fit.vutbr.cz,
http://www.fit.vutbr.cz/~peciva/
). Last modified: May 20, 2002