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

SDL Forum Index
Simple Directmedia Layer Forums
How can i use SDL 2 with windows.h?

Joined: 03 Feb 2014
Posts: 15
I heard that it was possible to do so with openGL, but SDL is able to do the same as openGL and it can do basic input by itself, and i know SDL so i didn't want to backtrack learning a library that does the same thing. But recently ive been pulling my hair out trying to get OIS(Object Oriented Input System) to work with my SDL 2 project. I've recently googled how to build OIS with CMake so i can link the .dll files to codeblocks, like i did with Box2D, it didnt work. I also tried importing the .cpp files and .h files from the folder in the OIS win32 folder labeled SDL, directly into my src and header folders in my project that didnt work either. Then i caught wind of a library built into windows called windows.h and I've read a tutorial on someone using it with openGL, but what about SDL? If ANYONE has a tutorial on this or know hows to work either windows.h or OIS with SDL 2, please post it.

Thanks Very Happy

Joined: 29 Aug 2014
Posts: 32
I am really confused after reading this post.

Assuming I understand you correctly, windows.h is a header file for the Windows API. You just include the header if you are building a Windows app. Normally you would do something like the below.


#if defined(_WINDOWS)
#define STRICT
#include <windows.h>