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.


Messages - ILostMyAccount

Pages: 1 [2]
16
General / Re: How should the code be organized?
« on: December 23, 2014, 01:01:37 pm »
Let's say something like:
Quote
#pragma once
#include <SFML/Graphics.hpp>
#include <string>

namespace Resources
{
   const std::string GAME_SPRITES_PATH = "Assets/Sprites/Game/";
   const std::string GUI_SPRITES_PATH = "Assets/Sprites/GUI/";


   sf::Texture mouseover_texture;
   sf::Sprite mouseover_sprite;
 

   bool LoadSprites();

}

17
General / Re: How should the code be organized?
« on: December 23, 2014, 12:52:47 pm »
If you think that takes up enough code that putting it in separate files makes your code base easier to work with, then go for it.

Though I would think "initializing sprites and sounds" involves loading some resources from files, which can't really be done in a C++ initialization, so you may need an actual class with a constructor.
I would add a "LoadSprites()" function to initialize them

18
General / Re: How should the code be organized?
« on: December 23, 2014, 12:45:08 pm »
One last thing, It's ok if I make a .cpp+.h that just contains a namespace where i declare and inizialize my sprites and sounds?

19
General / Re: How should the code be organized?
« on: December 22, 2014, 06:56:13 pm »
Thank you   :D

20
General / How should the code be organized?
« on: December 22, 2014, 02:33:43 pm »
I know that there are lots of ways but what do you do usually?
What's inside your main? Where do you initialize your sprites?
I've always used engines so I didn't really have to worry about it too much but now...


21
General / Re: What's wrong with this? (white sprites)
« on: December 19, 2014, 03:56:40 pm »
Nevermind i fixed it, I didn't use a pointer in my Tile constructor for the texture

22
General / What's wrong with this? (white sprites)
« on: December 19, 2014, 03:49:09 pm »
So, I wrote this:


The problem is that when I use it it draws white textures instead of the one that i've used  :-[

Pages: 1 [2]