When i run my game, i dont get any errors, the screen just doesnt load, heres my code:
game_functions.h:
#pragma once
#ifndef _game_functions_h_
#define _game_functions_h_
int getMaxObjects();
int getMaxSounds();
void GameSetup();
void GamePlaying(float angleX, float angleY);
void GameCleanup();
#endif
game_functions.cpp:
#include "DarkGDK.h"
#include "game_functions.h"
#define FLOOR 1
#define PLAYER_GUN 1
#define ALIEN_HIVEBRAIN 2
#define ALIEN_MUTANT 3
#define ALIEN_PSIONIC 4
int getMaxObjects()
{
int i = 0;
while(dbObjectExist(i))
i++;
return i;
}
int getMaxSounds()
{
int i = 0;
while(dbSoundExist(i))
i++;
return i;
}
void GameSetup()
{
dbSetDir("media");
dbMakeVector4(FLOOR);
dbLoadObject("ak47\\H-AK47-Static.x", PLAYER_GUN);
dbLoadObject("Alien Hivebrain\\H-Alien Hivebrain-Idle.x", ALIEN_HIVEBRAIN);
dbLoadObject("Alien Mutant\\H-Alien Mutant-Static.x", ALIEN_MUTANT);
dbLoadObject("Alien Psionic\\H-Alien Psionic-Idle.x", ALIEN_PSIONIC);
dbLockObjectOn(PLAYER_GUN);
}
void GamePlaying(float angleX, float angleY)
{
while(true)
{
dbPositionObject(PLAYER_GUN, dbCameraPositionX() + 2, dbCameraPositionY() - 2, dbCameraPositionZ());
dbControlCameraUsingArrowKeys(0, 2, 3);
angleX = dbWrapValue((angleX + dbMouseMoveY()));
angleY = dbWrapValue((angleY + dbMouseMoveX()));
dbXRotateCamera(angleX);
dbYRotateCamera(angleY);
dbPlayObject(ALIEN_HIVEBRAIN);
dbPlayObject(ALIEN_MUTANT);
dbPlayObject(ALIEN_PSIONIC);
if(dbEscapeKey())
break;
}
}
void GameCleanup()
{
while(true)
{
for(int i=0;i<getMaxObjects();i++)
{
dbDeleteObject(i);
}
for(int i=0;i<getMaxSounds();i++)
{
dbDeleteSound(i);
}
break;
}
}
Main.cpp:
#include "DarkGDK.h"
#include "game_functions.h"
void DarkGDK(void)
{
dbSyncOn();
dbSyncRate(60);
GameSetup();
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
while(LoopGDK())
{
GamePlaying(fCameraAngleX, fCameraAngleY);
GameCleanup();
dbSync ();
}
return;
}
any help would be appreciated