Jump to content

Game Lib?


Calimaw
 Share

Recommended Posts

I'm using 0.0.1.0 version with LE 2.32, but the current 0.0.0.19 version works fine with LE 2.31 too.

GameLib is using LEO too, so that's not a problem either.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

d:\program files\lwsdk\cpp\gamelib\gamelib.h(11) : fatal error C1083: Cannot open include file: 'gl/glut.h': No such file or directory

 

What is this error? I've downloaded the gamelib.cpp and gamelib.h from the wiki, and put them into lwsdk\cpp\gamelib, then added them to the includes.

Link to comment
Share on other sites

I've installed GLUT, but now I have other problems.

 

Murk Project contains Murk.cpp (game), and Gamelib.cpp

Additional Dependencies: opengl32.lib glu32.lib

Additional Include Directories: "D:\Program Files\LWSDK\CPP;D:\Program Files\LWSDK\CPP\LEO;D:\Program Files\LWSDK\CPP\GameLib"

 

 

1>------ Build started: Project: Murk, Configuration: Debug Win32 ------
1>Compiling...
1>Murk.cpp
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(5) : error C2065: 'TGame' : undeclared identifier
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(5) : error C2146: syntax error : missing ';' before identifier 'game'
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(5) : error C2065: 'game' : undeclared identifier
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(10) : error C2065: 'game' : undeclared identifier
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(10) : error C2228: left of '.Initialize' must have class/struct/union
1>        type is ''unknown-type''
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(14) : error C2065: 'game' : undeclared identifier
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(14) : error C2228: left of '.scene' must have class/struct/union
1>        type is ''unknown-type''
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(14) : error C2228: left of '.LoadMap' must have class/struct/union
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(23) : error C2065: 'game' : undeclared identifier
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(23) : error C2228: left of '.scene' must have class/struct/union
1>        type is ''unknown-type''
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(23) : error C2228: left of '.Update' must have class/struct/union
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(24) : error C2065: 'game' : undeclared identifier
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(24) : error C2228: left of '.scene' must have class/struct/union
1>        type is ''unknown-type''
1>e:\matt.matt-desktop\my documents\visual studio 2008\projects\murk\murk.cpp(24) : error C2228: left of '.Render' must have class/struct/union
1>Gamelib.cpp
1>LEO Leadwerk Engine Objects, version 2.3.1.
1>d:\program files\lwsdk\cpp\gamelib\window.cpp(42) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\program files\lwsdk\cpp\gamelib\window.cpp(48) : error C2664: 'LoadImageW' : cannot convert parameter 2 from 'const str' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\program files\lwsdk\cpp\gamelib\window.cpp(50) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char *' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>d:\program files\lwsdk\cpp\gamelib\window.cpp(56) : error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [19]' to 'LPCWSTR'
1>        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>Generating Code...
1>Build log was saved at "file://e:\Matt.MATT-DESKTOP\My Documents\Visual Studio 2008\Projects\Murk\Debug\BuildLog.htm"
1>Murk - 18 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

With game code of...

#include "gamelib.h"

int main()
{
       TGame game;

       Engine engine;

       engine.Create();
       game.Initialize( 800, 600 );
       Engine::SetFilters();
       Collisions::Set();

       game.scene.LoadMap( "abstract::murk01.sbx" );

       //Game loop
       while( !Keyboard::I****() && !Engine::IsTerminated() )
       {
           if( !Engine::IsSuspended() ) //We are not in focus!
           {

               // Render
               game.scene.Update();
               game.scene.Render();

               // Send to screen
               Engine::Flip(0);
           }
       }

       // Done
       return engine.Free();
}

Link to comment
Share on other sites

You should have gamelib.ico also in the SDK/CPP folder, but of course you should take a copy of it into your game source folder, and modify it to match your game logo.

 

Btw, Roland's LEWizard does all this automatically, it creates a gamelib project with all the correct settings.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...