Sign in to follow this  
  • entries
    24
  • comments
    28
  • views
    8274

My new 'core' library

Sign in to follow this  
SGreth

294 views

I had an awesome vacation last week, I didn't get too much done in the way of coding, but it really got me refreshed and ready to get back on the bandwagon both at work and here on the hobby-front.

Before I left I mentioned I wanted to go really simple, breakout-clone style. No more multi-player this, physics-that. Just some old school arcade action to get a completed title under my belt. I've been coding OpenGL & DirectX for too long to not have a completed game to my name!!!

Rather than just go kamakazi and code up some messiness, I'm organizing my code into a statically linked library and making it as modular as possible for me to build on and use again later.

So far I've ported over all of my old math stuff, my console binding library, and I've just finished the bare-minimum for my graphics foundation. Here is an example screenie & code to use the graphics library.




#include
#include "../KFCGraphics/KFCGraphics.h"
using namespace Kyrite::Graphics;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
CWindow window;
CSprite *pSprite = NULL;

// Create the window.
window.Create(hInstance, false, "WindowTestbed", 800, 600, 16);
window.SetClearColor(RGBA_MAKE(0, 0, 255, 0));

//Create the sprite.
pSprite = new CSprite(&window);
pSprite->SetTexture("CheckBoxCheck.dds", 0);
pSprite->SetSize(128.0f, 128.0f);
pSprite->MoveTo(300.0f, 300.0f);
pSprite->SetCentered(true);

// Application loop.
while(1)
{
window.BeginScene();
pSprite->Draw();
window.EndScene();
}

// Cleanup
delete pSprite;
return 0;
}


I have a basic GUI framework for my uber-engine that I'm kind of abandoning. In between tasks at work I'm starting to design a proper GUI that I'll use for my in-game editor. I'd like to distinctly seperate the GUI from any graphics and input so that it might be usefull to others, and if/when I have to upgrade my own graphics stuff, I don't have to redo all my GUI code :)
Sign in to follow this  


3 Comments


Recommended Comments

That's the directx image format (direct draw surface). You can snag plugins for photoshop from the nvidia developer website to export in that format. It's a pretty sweet plugin too as it lets you preview textures in various mipmap levels and also lets you work with normal maps, etc...

Share this comment


Link to comment

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