Jump to content

zinador

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by zinador

  1. All greetings, have compiled game, for me at the permission 640,480 work perfectly if to put the permission more that at start of my game Windows swear that cannot allocate memory, But an essence not in it. I give to the friend the compiled project with different permissions, and at it Windows too swears that Cannot to allocate memory, in what a problem and how it to correct? I so understand that it in project options it is necessary to climb? Help please source code game #include "engine.h" int main( int argn, char* argv[] ) { Initialize() ; SetAppTitle( "MyGame" ) ; Graphics(640,480 ) ; AFilter() ; TFilter() ; TWorld world; TBuffer gbuffer; TCamera camera; TMesh mesh; TLight light; TMesh ground; TMaterial material; world = CreateWorld() ; if (!world) { MessageBoxA(0,"Error","Failed to create world.",0); return Terminate(); } gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_COLOR|BUFFER_DEPTH|BUFFER_NORMAL); camera=CreateCamera(); mesh=CreateCube(camera); ground=CreateCube(); ScaleEntity(ground,Vec3(10,1,10)); PositionEntity(ground,Vec3(0,-2,0)); light=CreateDirectionalLight(); RotateEntity(light,Vec3(45,45,45)); //Управление TVec3 camrotation=Vec3(0); float mx=0; float my=0; float move=0; float strafe=0; // Игровой цикл while(!KeyHit(KEY_ESCAPE) && !AppTerminate() ) { //Управление и мышь mx=MouseX()-GraphicsWidth()/2; my=MouseY()-GraphicsHeight()/2; MoveMouse(GraphicsWidth()/2,GraphicsHeight()/2); camrotation.X=camrotation.X+my; camrotation.Y=camrotation.Y-mx; if(camrotation.X>80) { camrotation.X=80; } if(camrotation.X<-40) { camrotation.X=-40; } RotateEntity(camera,camrotation); move=Curve(KeyDown(KEY_W)-KeyDown(KEY_S),move,1000); strafe=Curve(KeyDown(KEY_D)-KeyDown(KEY_A),strafe,1000); MoveEntity(camera,Vec3(strafe,0,move)); if( !AppSuspended() ) { // Обновление времени и мира UpdateAppTime(); UpdateWorld(AppSpeed()) ; // Отрисовка SetBuffer(gbuffer); RenderWorld(); SetBuffer(BackBuffer()); RenderLights(gbuffer); Flip(0) ; } } return Terminate() ; }
×
×
  • Create New...