Im looking to create my game using files like subroutines.. is this possible?
For instance, id like to create a file, and put my DISPLAY commands in there, and load it when needed, Also id like there to be one for fog etc, so if i need for i just tell the program to goto that routine.
Somone suggested i use headers? is this a good way, i did have a breif play, but havent got it to work.
I think i need to tell my main.ccp to #include "display.h"
my display.h looks like this.
#ifndef UPDATE_S
#define UPDATE_S
void BeginTheLoading (void)
(
dbSyncOn ( );
dbSyncRate ( 120 );
dbSetDisplayMode ( 1024, 768, 32 );
dbSetWindowSize ( 1024, 768 );
dbSetWindowTitle ( "Adam's Game V1.2" );
dbScreenType ( );
dbSetWindowOff ( );
dbSetCameraRange(1, 50000);
)
#endif
I get a load of errors....
Error 2 error C2072: 'BeginTheLoading' : initialization of a function c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 8
Error 1 error C2143: syntax error : missing ')' before ';' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 8
Error 3 error C2440: 'initializing' : cannot convert from 'void' to 'void (void)' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 8
Error 5 error C2365: 'dbSyncRate' : redefinition; previous definition was 'function' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 9
Error 4 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 9
Error 8 error C2078: too many initializers c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 10
Error 7 error C2365: 'dbSetDisplayMode' : redefinition; previous definition was 'function' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 10
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 10
Error 11 error C2078: too many initializers c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 11
Error 10 error C2365: 'dbSetWindowSize' : redefinition; previous definition was 'function' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 11
Error 9 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 11
Error 13 error C2365: 'dbSetWindowTitle' : redefinition; previous definition was 'function' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 12
Error 14 error C2440: 'initializing' : cannot convert from 'const char [17]' to 'int' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 12
Error 12 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 12
Error 15 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 13
Error 18 error C2371: 'dbSetWindowOff' : redefinition; different basic types c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 14
Error 17 error C2556: 'int dbSetWindowOff(void)' : overloaded function differs only by return type from 'void dbSetWindowOff(void)' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 14
Error 16 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 14
Error 21 error C2078: too many initializers c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 15
Error 20 error C2365: 'dbSetCameraRange' : redefinition; previous definition was 'function' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 15
Error 19 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 15
Error 22 error C2059: syntax error : ')' c:\documents and settings\administrator\my documents\visual studio 2008\projects\dark gdk - 3d game1\dark gdk - 3d game1\display.h 17
I need some advice please. I think if i can master this then i can do each part like this, FOG.h SKYBOX.h etc....