Code:
#include "gpdef.h"
#include "gpstdlib.h"
#include "gpgraphic.h"
#include "gpmain.h"
GPDRAWSURFACE gpDraw[2];
char g_string[256];
int nflip = 0;
void GpMain(void *arg)
{
Init();
GameEngine;
AllDraw();
}
void Init()
{
int i;
GpClockSpeedChange(132000000, 0x24001, 2);
nflip = 1;
for(i = 0; i < 2; i++)
{
GpLcdSurfaceGet(&gpDraw[i], i);
}
GpRectFill(NULL, &gpDraw[nflip], 0, 0, gpDraw[nflip].buf_w, gpDraw[nflip].buf_h, 0xff);
}
void GameEngine()
{
while(1)
{
GpSurfaceFlip(&gpDraw[nflip++]);
nflip &= 0x01;
}
}
void AllDraw()
{
int cx, cy = 10, cw, ch;
//to draw text at the center of screen
gp_str_func.strcpy(g_string, "screen center");
cw = GpTextWidthGet(g_string);
ch = GpTextHeightGet(g_string);
cx = (LCD_WIDTH - cw) / 2;
cy = (LCD_HEIGHT - ch) / 2;
GpTextOut(NULL, &gpDraw, cx, cy, g_string, 0x02);
while(1);
}
im trying to get my text in the bottom right hand corner but i cant seem to get the cords right
also can somone give me an example of the key gets for the buttons(A,B,Select,Start) the gp32 example pack only has the movment pad
and how would i make a block of text disaperee after a certain amount of time?