|
???????????????????????????????:
#include <cstdlib>
#include <iostream>
#include <GEngine/Main.hpp>
using namespace std;
using namespace core;
int main(int argc, char *argv[])
{
Device *device = InitDevice("??????????");
device->SetClearColor(core::Color(80,100,230));
int x,y,z;
//! ??Opengl????
core::CoordinateSystem cs(COORDINATE_OPENGL);
device->SetCoordinateSystem(cs);
//! ??2D????
device->Ortho2D();
//! ???????
core::ResourceManager* resmgr = device->GetResourceManager();
core::RefPtr<core::Text> defont= resmgr->GetText("default_font");
char text[255];
char fpstext[20];
float fps = device->GetFPS();
BEGIN_LOOP(device);
device->GetInput()->GetMousePosition(x,y,z);
sprintf(text,"mouse position is :x = %d, y = %d,z = %d",x,y,z);
fps = device->GetFPS();
sprintf(fpstext,"fps is:%f",fps);
defont->Render(20,20,text);
defont->Render(540,20,fpstext);
END_LOOP(device);
device->Close();
device->Drop();
system(" AUSE");
return EXIT_SUCCESS;
}
??opengl???,??????????
????????????x???,y???,?????????

???? ??????????? |
|