New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature request - add SDL2_gfx #3

Closed
jojomickymack opened this Issue Apr 8, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@jojomickymack

jojomickymack commented Apr 8, 2018

gfx is the only missing child library - it's of debatable use since opengl is available, but is really a drop in library that would be fitting here.
http://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/

how to add to the project -

  1. add SDL2_gfx folder, add SDL2_gfx module to settings.gradle
  2. copy the build.gradle from the SDL2_mixer module, change mixer to gfx where it appears.
  3. add an entry in the main module's build.gradle referencing the include directory and shared library
SDL2_gfx {
    headers.srcDir "../SDL2_gfx/include"
    binaries.withType(SharedLibraryBinary) {
        sharedLibraryFile = file("${gradle.libDistributionRoot}/SDL2_gfx/lib/${targetPlatform.getName()}/libSDL2_gfx.so")
    }
}
  1. Download the gfx library from ferzkopp's site, put the .h files in the gfx's include directory (5 files), put the .c files in the src folder. Remove the c files with 'test' in the name (4 files).
  2. From the command line, you can run gradle :SDL2_gfx:distributeLib just like the others, and it will compile and link against SDL2.
  3. Now you can include the gfx headers in your main.cpp file and use it like normal.
#include "SDL2_gfxPrimitives.h"

@jojomickymack jojomickymack changed the title from feature request - add sdl_gfx to feature request - add SDL2_gfx Apr 8, 2018

georgik added a commit that referenced this issue May 7, 2018

georgik added a commit that referenced this issue May 7, 2018

@georgik

This comment has been minimized.

Owner

georgik commented May 7, 2018

@jojomickymack Thank you for the feature request and for detailed manual.
SDL2_gfx is now part of the sdl2-android-example.

Please test whether it works for you. Thank you very much.

@georgik georgik closed this May 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment