Re: An error when using SDL in C

Two cmake protips:

First:

mkdir build
cd build
cmake -G "NMake Makefiles" ..

Which will put all the .obj files out of your way. There might be something special you have to do with the .lib files however, probably setting the lib environment variable.  Alternatively you just have to ${CMAKE_CURRENT_SOURCE_DIR}/sdl2.lib instead of just sdl2.lib if I remember the name of the variable right.

Second, as your project gets larger, you'll want to use ninja.  It builds in parallel.  You can get that by just installing Visual Studio, and you may very well already have it.

It is very useful to create a libs directory somewhere,  add it to the LIB or maybe LIBPATH environment variable, and put all your .lib files there.  I forget if it's LIB or LIBPATH; it's been a very long time since I've had to do this, since most of my C time is Linux and most of my Windows C projects build their own dependencies as part of the project.

It will eventually get annoying to list all 20 of your c files on one line.  Be aware that CMake treats newlines like spaces, so you can just replace any space in a command with a newline and be fine.

The window becomes unresponsive because you aren't pumping the event queue.  This is likely why the title bar can't be read either.  If you don't pump the event queue, window messages never get responses, and that includes WM_GETOBJECT, which is used by screen readers to get accessibility info.  With NVDA at least, this can sometimes go so badly wrong that you have to force restart NVDA, however that's fortunately rare these days and having the program close itself after 2 seconds is saving you from it.  You don't even need to do anything particular with the events to make this work: the problem is that pumping the SDL event queue pumps the event queue SDL reads from, which is the event queue by the OS, which for Windows specific reasons has additional Windows-provided magic in it that probably shouldn't have ever been put there in hindsight.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector

Reply via email to