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

Pages: 1 ... 23 24 [25]
361
General / Re: Small RPG design layout.
« on: April 23, 2013, 09:25:21 pm »
well, i wouldn't change much about it, although i'm too newbie to say if it's good or not :P
how did you created this layout? in which program?
i'm curious to see others opinions too...

362
General discussions / Re: SFML v SDL?
« on: August 31, 2012, 01:23:34 am »
as i'm new to programming in general, i've tried some engines like SDL and SFML, to see wich one is the best.
honestly, both seems to be good. but SFML has many functions that i didn't found in SDL. and is a little easier, too. so...

363
Audio / Re: sf::music causes a crash?
« on: August 31, 2012, 01:03:13 am »
oops, sorry, i searched only this forum.  :-\

i'll wait, then. thanks.

364
Audio / sf::music causes a crash?
« on: August 31, 2012, 12:23:31 am »
hello
i'm having a strange issue when i try to create a music object.
the program runs fine, but at the finish, windows give a error message "test.exe stopped working"

all i have to do is write sf::Music test! a minimal example that reproduces the problem:

#include "SFML/Audio.hpp"
int main(){
    sf::Music test;
    return 0;
}

in a complete example, the music DOES play, and the program runs fine. for some reason, it occurs after the 'return 0' from main().

in the console output:
process returned 255 (0xFF)

is this normal? the program runs fine, so i don't know...
i'm running on windows 7 SP1, SFML 2.0rc, Code::Blocks 10.05

thanks in advance!

365
Graphics / Re: Member function sprite call
« on: August 30, 2012, 07:40:49 am »
hi
this question bothered for a long time, too. it's a C++ question, not SFML.
for this, you should use the reference and dereference operators.
you need a function inside your class that gets the variable from main(). like this:

int classFunction (sf::Renderwindow* window){
    window->draw(sprite); //here you use -> instead of a dot.
    return 0;
}

and in the main(), when you call the classFunction:

invadorObject.classFunction(&window);

hope that it helps :)

366
Graphics / Re: SFML2 blinking screen
« on: August 28, 2012, 01:10:41 am »
GEE! i figured out what i was doing wrong!
in the "mapa.desMapa" function, everytime i draw a tile, i also use window->display(). without clearing the screen nor anything. and then, in the main loop, everything is drawn again!

like this, there's no way anyone could ever help me :P sorry for that, my fault. i did not wanted to post too much code at once...

just took that line off, and now everything is working like a charm.


the 'for' loop, as the 'system("pause") and the header are there just for tests. i'm not making any real game yet, just learning.
but thanks for the hints, anyway :)


EDIT: i forgot, thanks to everyone who tried to help me too   :D

367
Graphics / Re: SFML2 blinking screen
« on: August 27, 2012, 04:58:45 pm »
no worries. i'm still learning too :) i'm newbie to both SFML and C++ (and anything beyond RPG Maker).

well, that's a good thinking. but i what i understand is that the "sleep" function halts the whole program, to reduce RAM usage. and the  "limit framerate" only limits the screen refresh.
anyway, it still doesn't work if i take ou the "limit framerate" line, nor if i take out the "sleep" line  :-\

maybe i should make a double buffer? doesn't SFML do that by default?
also, i think its very strange that window.display() makes the screen black...

368
Graphics / Re: SFML2 blinking screen
« on: August 27, 2012, 04:24:31 pm »
thanks for the answers

but if i put the line
sf::sleep(sf::milliseconds(10));
after the window.display(), or before the window.clear(), the screen blinks even worse.
the only way it doesn't blink is if i take out the window.clear().

also, there's no real render loop. i'm just testing if the tilemap works...


369
Graphics / SFML2 blinking screen
« on: August 27, 2012, 03:54:27 pm »
hello everybody!
first, i'd like to thank the creator and contributors of this library. it's really easy to understand, and is helping me a lot in learning on how to make a game.

then, i have a question that i believe it's simple.
i have loaded a texture and then created a sprite. this sprite is a tile, so i draw it a lot of times in the screen. then i update the screen, and draw all over again.
the problem is that the screen blinks every time it draws the tiles. (it blinks all tiles at once, and not one at time)
i don't know what could be wrong.

this is how i made it:

#include "head.h"
int main(){
    sf::RenderWindow window(sf::VideoMode (480, 480), "Jogo2");
    window.setFramerateLimit(60);
    Mapa mapa;
    mapa.criarMapa();
    for (int i = 0; i<100; i++){
        window.clear();
        mapa.desMapa(&window); //[b]see note below for this[/b]
        sf::sleep(sf::milliseconds(10));
        window.display();
    }
    system("pause");
    return 0;
}

note: the line mapa.desMapa(&window) draws the tiles on the screen. it does the following:
    window->draw(sChaoPedr); //draw the sprite
    sChaoPedr.setPosition(mapX*48, mapY*48); //set the sprite position
for each tile.

for some reason, it seems that window.display() clears the screen! after this comand, the screen turns black. i don't know why.

do i have to create one sprite for each tile?
if anyone thinks the error is somewhere else, please let me know, so i'll put the whole code.

i'm working on windows 7 SP1, SFML 2.0rc, Code::Blocks 10.05 (and the default mingw and gcc shipped with it).

thanks in advance :)

Pages: 1 ... 23 24 [25]