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
Using SDL2 WinRT with SDL2_gfx
Meldryt


Joined: 22 Oct 2014
Posts: 36
Location: Munich
We need more draw functions like drawing filled circles or polygons.
I think SDL2_gfx is the best draw library.
But is it also possible to include and use SDL2_gfx in SDL2 WinRT projects?
DLudwig


Joined: 09 Feb 2012
Posts: 179
I haven't specifically tried running SDL_gfx on WinRT, or doing any work to get it running there. Most of my own work has limited to official SDL satellite libraries, of which I don't believe SDL_gfx is one. I wouldn't be surprised if it could be made to run on WinRT with little effort, perhaps just creating MSVC projects for it, or even including its sources directly in an app. I haven't used it in years though, and my knowledge of it was somewhat limited. I'm not sure how portable it is. Generally speaking though, if a library's API calls are limited to ANSI C and SDL calls, getting something running on WinRT is a matter of setting up projects in MSVC, and occasionally hand-editing some config files, or setting up some preprocessor #defines.
Meldryt


Joined: 22 Oct 2014
Posts: 36
Location: Munich
couldnt include the gfx library in my WinRT project, so i copied the relevant draw functions in my class. problem solved.
DLudwig


Joined: 09 Feb 2012
Posts: 179
Meldryt wrote:
couldnt include the gfx library in my WinRT project, so i copied the relevant draw functions in my class. problem solved.


This is good to know. Thanks for the info!
Meldryt


Joined: 22 Oct 2014
Posts: 36
Location: Munich
update: tried to include only the header and class files in my project. it works for the emulator.
when i compile for device i get this error: SDL2_gfxPrimitives.cpp(1770): error C3861: '__emit': identifier not found
DLudwig


Joined: 09 Feb 2012
Posts: 179
Meldryt wrote:
update: tried to include only the header and class files in my project. it works for the emulator.
when i compile for device i get this error: SDL2_gfxPrimitives.cpp(1770): error C3861: '__emit': identifier not found


Odd.

Can you compile the file a C code, rather than C++? I'm able to compile SDL2_gfxPrimitives for device/ARM, but only when compiling it as C code. When I compile as C++, I get the same error.

-- David L.
Meldryt


Joined: 22 Oct 2014
Posts: 36
Location: Munich
yes i can compile with c code. should keep it as .c file...