Exemplo n.º 1
0
Arquivo: nge.c Projeto: eledot/libnge2
void NGE_SetScreenContext(const char* winname,int screen_width,int screen_height,int screen_bpp,int screen_full)
{
	screen_context_p screen = GetScreenContext();
	int len;

	if (screen->name != NULL)
		free(screen->name);

	if(winname == NULL)
		screen->name = NULL;
	else {
		len = strlen(winname) + 1;
		screen->name = malloc(len);
		strncpy(screen->name,winname,len);
	}

	screen->width = screen_width;
	screen->height = screen_height;
	screen->bpp = screen_bpp;
	screen->fullscreen = screen_full;
	if(set_ori_default == 0){
		screen->ori_width = screen_width;
		screen->ori_height = screen_height;
		screen->rate_h = screen->rate_w = 1.0f;
	}
}
Exemplo n.º 2
0
	void Java_org_libnge_nge2_NGE2_nativeSetContext(JNIEnv* env,
        jobject thiz,jint w,jint h)
	{
		NGE_SetScreenContext("NGE2A",w,h,32,1);
		nge_print("screenW:%d,screenH:%d",w,h);

		screen = GetScreenContext();
	}
Exemplo n.º 3
0
Arquivo: nge.c Projeto: eledot/libnge2
void NGE_SetOriginalResolution(int width,int height)
{
	screen_context_p screen = GetScreenContext();
	screen->ori_width = width;
	screen->ori_height = height;
	screen->rate_w = 1.0f * width/screen->width;
	screen->rate_h = 1.0f * height/screen->height;
	set_ori_default = 1; 
}
Exemplo n.º 4
0
	void Java_org_libnge_nge2_NGE2_nativeSetWorkPath(JNIEnv* env,
	        jobject thiz,jstring packname)
	{
			screen = GetScreenContext();
			char* name = jstringTostring(env, packname);
			chdir(name);
			nge_print("nge2 set workpath:%s.\n",name);
			memset(screen->pathname,0,256);
			strncpy(screen->pathname,name,256);
			if(name)
				free(name);
			
	}