Jump to content
  • Advertisement
  • entries
    707
  • comments
    1173
  • views
    436777

wewt!

Sign in to follow this  
Programmer16

152 views

I'm done complaining about VC++ Express Edition. I uninstalled and reinstalled (which took like 3 hours because of my crappy internet connection -_-) and intellisense works much better now (not always, but most of the time. Before it pretty much wasn't working at all.) BUT, more importantly it works with STL and boost, which VS2K3 does not, which makes me super happy. The only complaint that I have left is that it doesn't detect user-types like C# EE does, which makes me sad.



I'm part way through porting my MalykAI code-base, which has pretty much turned into a complete re-write. MalykAI's current code-base was pretty much hacked together (the fact that it's in a single file pretty much shows that.) The new system is way better though. Here's how it's going so far:

#include
#include "dftDebugging.h"
#include "dftString.h"
#include "dftConfigReader.h"
#include "dftMath.h"
#include "dftGraphics.h"
#include "dftSystems.h"
#include "dftEngine.h"
#include
#pragma comment(lib, "d3d9")
#pragma comment(lib, "d3dx9")

class Game : public dft::Systems::BaseGame
{
public:
Game(const std::string& Name) : dft::Systems::BaseGame(Name)
{
}

bool Initialize()
{
return true;
}

void Update(float Seconds)
{
}

void Frame()
{
}

void CleanUp()
{
}

bool OnKeyDown(int VirtKey, long KeyData)
{
if(VirtKey == VK_ESCAPE)
{
PostQuitMessage(0);
return true;
}
return false;
}
};

int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Game MyGame("Test Game");
dft::Systems::Engine::Access()->ClearColor = 0xff6495ed;
dft::Systems::Engine::Access()->Run(&MyGame);
}

// Fallback catch blocks
catch(const dft::UnuseableValueException Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }
catch(const dft::NullException &Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }
catch(const dft::DivideByZeroException &Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }
catch(const dft::FileNotFoundException &Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }
catch(const dft::BadPointerException &Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }
catch(const dft::ItemFoundException &Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }
catch(const dft::ItemNotFoundException &Exception) { Exception.LogToHtmlLog(); dft::Tracing::Dump(); }

dft::HtmlLog::Close();
return 0;
}


(Note: Ignore the catch statements, they're my backups in case I forget to catch stuff in the right place. Tracing can be removed now as it traced function calls, but I don't need it now that VC++ EE is working right.)

BaseGame has virtual methods for all input messages:

virtual bool OnKeyDown(int VirtKey, long KeyData) { return false; }
virtual bool OnKeyUp(int VirtKey, long KeyData) { return false; }
virtual bool OnChar(char CharCode, long KeyData) { return false; }
virtual bool OnLeftClick(int Keys, int X, int Y, bool DoubleClick) { return false; }
virtual bool OnLeftRelease(int Keys, int X, int Y, bool DoubleClick) { return false; }
virtual bool OnMiddleClick(int Keys, int X, int Y, bool DoubleClick) { return false; }
virtual bool OnMiddleRelease(int Keys, int X, int Y, bool DoubleClick) { return false; }
virtual bool OnRightClick(int Keys, int X, int Y, bool DoubleClick) { return false; }
virtual bool OnRightRelease(int Keys, int X, int Y, bool DoubleClick) { return false; }
virtual bool OnMouseMove(int Keys, int X, int Y) { return false; }
virtual bool OnMouseWheel(int Keys, int X, int Y, int ZDelta) { return false; }



There'll be more functionality once I've been able to spend more than 10 minutes on it lol.

Anyway, bedtime for me.

Edit: Btw, check out my last entry for a screenshot and description of my small RPG project for OpenXNA. I'm going to do each part and then write an article on each. I finished the map system earlier today (first pass; needs to be cleaned up a little bit) and I did some work on the article for it. Hopefully I can have it finished by monday to upload it.
Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!