gfx sdlgl verion slowly slowly..

master
steffen 13 years ago
parent e8570aced2
commit 4084e0475d

@ -127,6 +127,9 @@ help:
configandroid: clean
cp -f Makefile.rules.android Makefile.rules
mkdir android/assets
cp -f data/*.ttf android/assets
cp -f data/*.png android/assets
for i in $(ANDROIDDIRS); do ln -s ../../$$i android/jni/ ; done
configwin: clean
@ -165,6 +168,7 @@ cleanall:
for i in $(WINCEDIRS); do make -C $$i clean; done
for i in $(SDLGLDIRS); do make -C $$i clean; done
for i in $(ANDROIDDIRS); do rm -f android/jni/$$i; done
rm -rf android/assets
cd android; make clean; cd ..
rm -rf sposmroute
rm -rf sposmroutegl

@ -54,7 +54,7 @@ void config_init () {
struct stat sb;
strcpy (cfg.mappath, "map/");
strcpy (cfg.appdatapath, "android/assets");
strcpy (cfg.appdatapath, "data");
strcpy (cfg.cachepath, "cache/");
strcpy (cfg.configpath, "");
strcpy (cfg.logpath, "logs/");
@ -66,6 +66,7 @@ void config_init () {
/* Android version will not need config and log path.. */
#if defined(ANDROID)
strcpy (cfg.appdatapath, "android/assets");
if (engine.app->activity->internalDataPath == NULL)
strncpy (cfg.configpath, "/data/data/de.gulpe.sposmroute/", LEN_FILENAME);
else

@ -156,7 +156,6 @@ void draw_gui () {
tmplinestyle.c = tmplinestyle.borderc = color[COLOR_white][3];
draw_line (NULL, mousepos.x-5, mousepos.y-5, mousepos.x+5, mousepos.y+5, tmplinestyle);
draw_line (NULL, mousepos.x+5, mousepos.y-5, mousepos.x-5, mousepos.y+5, tmplinestyle);
gfx_draw_text (NULL, mousepos.x, mousepos.y, "nur ein test.", &color[COLOR_yellow][2]);
/*
* draw selected position

@ -55,7 +55,7 @@ struct font* font_load(char *name) {
exit (1);;
}
FT_Set_Pixel_Sizes(f->face, 0, 16);
FT_Set_Pixel_Sizes(f->face, 0, 12);
d_printf ("font loaded (size:%d).", f->buffersize);
return f;

@ -39,7 +39,7 @@
iPoint gfx_screensize = {0, 0};
int gfx_last_alloc_img = 0;
int gfx_last_img_fbo = 0;
struct font *font = NULL;
void gfx_fbo_switch (struct image *img);
/*****************************************************************************/
@ -64,6 +64,7 @@ void gfx_init (int width, int height) {
gfx_screensize.x = width;
gfx_screensize.y = height;
gfx_resize (width, height);
font = font_load ("FreeSans.ttf");
};
@ -175,6 +176,8 @@ void gfx_draw_polygon (struct image *dimg, iPoint *p, int pcnt, struct line_styl
*/
void gfx_draw_text (struct image *dimg, int x, int y, char *text, struct color *c) {
gfx_fbo_switch (dimg);
glColor4f (c->c.r, c->c.g, c->c.b, 1.0f);
font_draw (font, text, x, y+12.0, 1.0, 1.0);
};

@ -61,7 +61,7 @@ void test_draw () {
}
if (_tmpx > img->width-TEST_WIDTH) _tmpdx = -1;
if (_tmpx < 0) _tmpdx = 1;
if (_delay % 20 == 0) _tmpx += _tmpdx;
if (_delay % 1 == 0) _tmpx += _tmpdx;
if (_tmpy > img->height-TEST_WIDTH) _tmpdy = -1;
if (_tmpy < 0) _tmpdy = 1;
@ -130,8 +130,8 @@ int msdl_eventloop () {
exit (2);
}
gfx_resize (event.resize.w, event.resize.h);
// draw ();
test_draw ();
draw ();
// test_draw ();
}
break;
case SDL_MOUSEMOTION:
@ -139,9 +139,9 @@ int msdl_eventloop () {
gevent.mousepos.y = event.motion.y;
gevent.mousebtn = 0;
gevent.event = EGUI_MOUSEMOVE;
// gui_event (gevent);
// draw_mousemove (event.motion.x, event.motion.y, -1);
test_draw();
gui_event (gevent);
draw_mousemove (event.motion.x, event.motion.y, -1);
// test_draw();
break;
case SDL_MOUSEBUTTONDOWN:
@ -179,14 +179,15 @@ int main (int argc, char **argv) {
}
app_init (argc, argv);
font_init ();
gfx_init (RESOLUTION_X, RESOLUTION_Y);
test_draw ();
// draw ();
// test_draw ();
draw ();
while (app.status != APPSTATUS_quit) {
msdl_eventloop ();
test_draw ();
// draw ();
while (msdl_eventloop ());
// test_draw ();
draw ();
}
SDL_Quit ();

Loading…
Cancel
Save