Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Kalnos

Pages: [1]
1
General / VS2010 C#/.NET and SFML 2.0
« on: February 13, 2011, 06:45:11 am »
So, I'm following the tutorial to setup SFML 2.0 using Cmake, and I'm unsure how I should continue at the point in which you would normally open the VS 2010 C++ command prompt to configure and use the >cmake command.  The thing is, as far as I know, the C# version doesn't have a command prompt  :? ?

Does anyone have any advice on how I can get this setup?  Also, just to check, is .NET supported for SFML 2.0 at this point, or am I jumping the gun?

Thanks for any help.  :)

2
General / Need advice on code structure
« on: June 20, 2010, 03:36:42 am »
Hey guys, I'm pretty new to the C++ / SFML scene and was wanting some advice from more experienced users on how to handle this.  I'm starting by writing a simple Tetris like game, and one thing i'm particularly stumped on is the way to handle images.  I've set up a class that manages images so that they're not loaded more than once by storing them in a map.  The problem, though, lies in where I should declare the instance of this imagecache in my code.

An example I saw on this site was a Singleton pattern like:

Code: [Select]

static ImageManager &get()
{
static ImageManager imgManager;
return imgManager;
}


I don't really want to use a method like this, but I don't really have any good idea of where the cache should be placed.  

I've thought of placing it in a generic Entity class in which the Blocks and Player, etc is derived from, but this seems like it would alienate the manager from things like background images and things that aren't derived from this class.  Declaring it in the main loop just seems hectic as it requires me to pass a reference to the manager like Game --> Board --> Block --> etc just to set a sprites image, which seems like poor structure.

My question to you guys then, is how would you suggest I handle creating an instance of my imagecache class.  I don't care if you link me sample code, a tutorial, or anything, I'm just lost as to where I should put it so that it's efficient and not cryptic.

Pages: [1]