I'm trying to get gapidraw to work to use it in my next project, but I've some basic problems that I hope someone can help me with.
I initiate the screen with OpenDisplay and get a backbuffer which I fill with a colored rectangle, then I do a flip and it works great.
But when I try to draw a new rectangle from another function and do a flip nothing happends. What can I be doing wrong?
I declare global classes as follows:
//
class CGapiDisplay* disp = NULL; (define.cpp)
extern class CGapiDisplay* disp; (define.hpp)
Then in my init function InitInstance( ...
//
disp = new CGapiDisplay;
back = new CGapiDisplay;
if( disp->OpenDisplay( GDDISPLAY_FULLSCREEN, main_hWnd, 240, 320, NULL, NULL, NULL, NULL) != GD_OK)
PostQuitMessage(0);
disp->SetDisplayMode(GDDISPMODE_NORMAL);
disp->GetBackBuffer(back);
back->FillRect( NULL, RGB(255, 0, 255), 0, NULL);
disp->Flip();
Which works fine, but then in another function directly after I do the following:
back->FillRect( NULL, RGB(255,255,0), 0, NULL);
disp->Flip();
And nothing happends, what do I do wrong? I probably misseds something basic cause I'm kind of new to working with classes, anyone have an idea?
/nB
I initiate the screen with OpenDisplay and get a backbuffer which I fill with a colored rectangle, then I do a flip and it works great.
But when I try to draw a new rectangle from another function and do a flip nothing happends. What can I be doing wrong?
I declare global classes as follows:
//
class CGapiDisplay* disp = NULL; (define.cpp)
extern class CGapiDisplay* disp; (define.hpp)
Then in my init function InitInstance( ...
//
disp = new CGapiDisplay;
back = new CGapiDisplay;
if( disp->OpenDisplay( GDDISPLAY_FULLSCREEN, main_hWnd, 240, 320, NULL, NULL, NULL, NULL) != GD_OK)
PostQuitMessage(0);
disp->SetDisplayMode(GDDISPMODE_NORMAL);
disp->GetBackBuffer(back);
back->FillRect( NULL, RGB(255, 0, 255), 0, NULL);
disp->Flip();
Which works fine, but then in another function directly after I do the following:
back->FillRect( NULL, RGB(255,255,0), 0, NULL);
disp->Flip();
And nothing happends, what do I do wrong? I probably misseds something basic cause I'm kind of new to working with classes, anyone have an idea?
/nB