/**
* Window Management
*/
-JNIEXPORT void JNICALL Java_sdl_SDL_setCaption(JNIEnv *env, jobject obj, jstring title, jint icon){
+JNIEXPORT void JNICALL Java_sdl_SDL_setCaption(JNIEnv *env, jobject obj, jstring title, jstring icon){
+ const char* title_string = NULL;
+ const char* icon_string = NULL;
+ if(title != NULL){
+ title_string = (*env)->GetStringUTFChars(env, title, NULL);
+ }
+ if(icon != NULL){
+ icon_string = (*env)->GetStringUTFChars(env, icon, NULL);
+ }
+
+ SDL_WM_SetCaption(title_string, icon_string);
}
JNIEXPORT jlong JNICALL Java_sdl_SDL_getTicks(JNIEnv *env, jobject obj){
//-------------------------------------------------
// Window Management
//-------------------------------------------------
- def setCaption(title:String, icon:Int):Unit = return sdl.setCaption(title, icon)
+ def setCaption(title:String, icon:String):Unit = return sdl.setCaption(title, icon)
//-------------------------------------------------
// TIME
//int SDL_SetPalette(SDL_Surface* surface, int flags, SDL_Color* colors, int firstcolor, int ncolors)
@native def setPalette(surface:SDL_Surface, flags:Int, colors:Array[SDL_Color], firstcolor:Int, ncolors:Int):Int
//int SDL_SetGamma(float redgamma, float greengamma, float bluegamma)
-
//int SDL_GetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable)
-
//int SDL_SetGammaRamp(Uint16 *redtable, Uint16 *greentable, Uint16 *bluetable)
-
//Uint32 SDL_MapRGB(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b)
@native def mapRGB(fmt:SDL_PixelFormat, r:Int, g:Int, b:Int):Int
//Uint32 SDL_MapRGBA(SDL_PixelFormat *fmt, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
-
//void SDL_GetRGB(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b)
-
//void SDL_GetRGBA(Uint32 pixel, SDL_PixelFormat *fmt, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
-
//SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int bitsPerPixel, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
@native def createRGBSurface(flags:Int, width:Int, height:Int, bitsPerPixel:Int, Rmask:Int, Gmask:Int, Bmask:Int, Amask:Int):SDL_Surface
//SDL_Surface *SDL_CreateRGBSurfaceFrom(void *pixels,int width, int height, int depth, int pitch,Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
//-------------------------------------------------
//int SDL_GetWMInfo(SDL_SysWMinfo *info)
//void SDL_WM_SetCaption(const char *title, const char *icon)
- @native def setCaption(title:String, icon:Int):Unit
+ @native def setCaption(title:String, icon:String):Unit
//void SDL_WM_GetCaption(char **title, char **icon)
//void SDL_WM_SetIcon(SDL_Surface *icon, Uint8 *mask)
//int SDL_WM_IconifyWindow(void)