The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Does SDL_opengl.h need to include windows.h?
jasonericson


Joined: 15 Apr 2014
Posts: 1
I had a (relatively minor) issue with my SDL project where my autocomplete menu was filled with options from Windows API files all over the place. We weren't including windows.h anywhere, so we did some hunting and found it included in SDL_opengl.h. Interestingly, when we commented that out as an experiment, everything built just fine and our auto-complete lists were much more manageable as a result. Is there any reason that include needs to be there anymore or can it be taken out? It seems like it would be less bloat.

At any rate, we'll be leaving it out of our project unless it begins to cause us problems.
Does SDL_opengl.h need to include windows.h?
Sik


Joined: 26 Nov 2011
Posts: 905
I know that on Visual Studio, including gl/gl.h requires also
including windows.h for some reason. On MinGW(-w64) this isn't the
case and it can be left out.

No idea how this applies to SDL_opengl.h but I wouldn't be surprised
if there's a similar issue.

2015-01-27 21:02 GMT-03:00, jasonericson:
Quote:
I had a (relatively minor) issue with my SDL project where my autocomplete
menu was filled with options from Windows API files all over the place. We
weren't including windows.h anywhere, so we did some hunting and found it
included in SDL_opengl.h. Interestingly, when we commented that out as an
experiment, everything built just fine and our auto-complete lists were much
more manageable as a result. Is there any reason that include needs to be
there anymore or can it be taken out? It seems like it would be less bloat.

At any rate, we'll be leaving it out of our project unless it begins to
cause us problems.





_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SiPlus


Joined: 06 Feb 2015
Posts: 13
It's used for APIENTRY, which is defined as __stdcall if ((_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)). Even though on ARM __stdcall is ignored, I think it would be better to keep including Windows.h to avoid possible problems in the future.