SDL2 with windows and code::block


#1

Hello,
i try to launch a minimalist code to launch a SDL window. you can find it with this link: premier code.
http://alexandre-laurent.developpez.com/tutoriels/sdl-2/installation-et-configuration/[http://alexandre-laurent.developpez.com/tutoriels/sdl-2/installation-et-configuration/]
I have configured code::block and when i build it is Ok but when i launch the code, i have an error message saying that directX not available.
Any suggestion?
thanks


#2

I’m assuming you’re on Windows. Which version is it exactly?

SDL provides a feature that lets you select the video driver with an environment variable. The variable is called SDL_VIDEODRIVER. If you set this environment variable to “directx”, SDL 2 will complain that it doesn’t have such a driver with “directx not available”.

“directx” is a video driver in SDL 1.2. Perhaps you have this environment variable set for your user or system?

Try opening cmd.exe, type SET and press enter. This will list all environment variables. Check if there are any SDL_* variables set. If you find SDL_VIDEODRIVER, you can delete it in the appropriate control panel menu. There are a few resources like this on the internet on how to do that.

It’s possible that code::blocks has the ability to set environment variables for the programs it is launching. Check in its configuration if there’s anything.


#3

Hi,

Please download our open-source cross-platform game “LettersFall 5” below:
http://16bitsoft.com/files/LF5-Win10/LettersFall5.zip

Just decompress and then open the “LettersFall5Game.workspace” file with Code::Blocks.
Feel free to read, modify, and use the source code for your own projects.
Game will be released for free on Windows 10 Store very soon…

JeZxLee
16BitSoft Inc.
Video Game Design Studio
www.16BitSoft.com


#4

Hello,
that was that!
Thanks a lot!