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 - santiaboy

Pages: 1 [2]
Graphics / [SOLVED] Knowing the style of the RenderWindow?
« on: March 22, 2013, 07:50:55 pm »
Hey guys, im re-making my Options menu, and I was wondering if there was some way of knowing the style of a renderwindow. I looked at the documentation, but there isn't a .getStyle() or anyting similar.

I wanted to do something like this
if(!windowIsFullscreen && fullscreenOptionChecked){
    window.create(VideoMode, "Blah", Style::Fullscreen);

without recurring to using bools(windowIsFUllscreen, windowIsWithoutBorder, etc) so it would be like
if(window.getStyle() == Style::Fullscreen && fullscreenOptionChecked){
    window.create(VideoMode, "Blah", Style::Fullscreen);

EDIT: I know the .getStyle() doesn't exist, I just wrote it for clarification of what I wanted  ::)

Graphics / [SOLVED] Not having a sf::text crashes my code
« on: March 04, 2013, 08:44:12 pm »
I happened to encounter an unusual thing. I made a Breakout clone, and I wanted to make another game, using the same screens, and changing Texts, etc.
Before I had 3 sf::text and now I want only one. So I erased one(erase all the code concerning that sf::text), and everything works, but when I want to erase the other one it crashes as soon as it loads it. Also, it crashes only on Release mode, so I can't use watches, breakpoints, etc.

This is the error that gives me "Process terminated with status -1073741676", apparently it is a division by 0 error.

Strangely enough, I can remove everything but the .setString() line. Everything else I can remove it and it works, even the window.draw(_textoSetCentradoTitulo) line. (code below)

any ideas?

class MenuSeleccion : public GameState{

    Text _textoPrimerosPasos;
    Text _textoSetCentradoTitulo;


    void eventosYMuevo();
    void update();
    void render();



    _textoPrimerosPasos.setString("Primeros Pasos:");
    _textoPrimerosPasos.setCharacterSize (pantalla_alto * 7 / 120);
    _textoPrimerosPasos.setPosition(pantalla_alto * 2 / 15, pantalla_alto / 6);

    _textoSetCentradoTitulo.setString("Set Centrado:"); ///I can remove everything but this line
    //_textoSetCentradoTitulo.setCharacterSize (pantalla_alto * 7 / 120);
    //_textoSetCentradoTitulo.setPosition(pantalla_alto * 2 / 15, pantalla_alto * 17 / 30);
   // _textoSetCentradoTitulo.setFont(myFont);


General / Drawing everything? Checking collision with all solid tiles?
« on: February 27, 2013, 11:48:49 pm »
Hi, i've been developing a simple 2d platformer in c++, using SFML, and have some general questions

Do I draw everything or just the things on screen? Drawing everything is easier as it requires less work for me, but it seems that it is a badpractice as it utilizes more resources than what it is actually needed. ( I have a "tiles" list and I go throught it with an iterator + for loop)

Also, Do I check collision with solid tiles? Same as above. It's easier but consumes more resources.

What I mean is this: does checking if something will be on screen or not(so I draw it or not), or if something is near my character or not (collision) waste far less resources than just doing it for everything?

If you want me to clarify some things tell me, and I'll do my best.

General / [SOLVED] Is it possible to release a game without the DLL?
« on: February 15, 2013, 06:41:35 pm »
Hey guys!

I made a Breakout clone, and when I want to send the game to my friends, I have to include the .dll in the same place as the .exe. Is there any way to avoid this? I know they are ~5-7 MB, but the whole game is less than 20 MB.

If that's not possible, I thought of making a "bin" folder, and put the .exe and .dll there. However, I run into a bit of a problem. I have some resources on a "resource" folder(see NOTE below) that I need to load. I coded so they load "resources/file.png". However if the .exe is in the bin folder, how do I go up a level?


NOTE(files I have right now):
resources (images, music, sounds..)
levels (.txt, I made a custom level loader)
.exe and .dll (not in a folder)

Graphics / Using the same image with different resolutions?
« on: January 31, 2013, 08:20:57 pm »
Hey guys, I've been developing a Breakout clone in 800x600. I wanted to try and make it so people could play on different resolutions.

The problem is that the textures I've been using for the 800x600 version get blurry when the reslolution changes to, for example, 1680x1050. So, I went and made bigger images. However, there is still a problem: when playing on 800x600 now the "HD" textures look blurry.

Is there a way to solve this? How is it normally solved in a game? Do they have the same imagen in a bunch of different resolutions?

images (1, 2 low def; 3, 4 "high def") http://imgur.com/a/OdWgE#0

I was kinda hoping not to use black bars, unless it really simplifies it.

Audio / How to check if a music has been loaded?
« on: January 25, 2013, 02:42:12 am »
Is there a way to check if the music has been loaded before? (without needing a bool variable)

I read the documentation and I don't seem to find it

Pages: 1 [2]