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

Pages: 1 [2]
16
General / How does the timers/clocks work?
« on: October 24, 2012, 01:03:26 am »
Hi everybody :)

I dont really understand the timers/clocks. I just want my game to be on 60 fps on any computer.
In Allegro, it was very very easy.... just make a variable, start it and wupti... its 60 fps.

But in SFML it seems a little more confusing to me.

i looked at the tutorial here:
http://www.sfml-dev.org/tutorials/2.0/system-time.php

But i didn't really understand it :(

Hope someone helps
thanks!!!!  ;D

17
General / How do i make my bitmap transparent? sfml2.0
« on: October 21, 2012, 02:18:21 pm »
In 2.0 theres no "CreateMaskFromColor" from my textures.
So how do i make my background transparent if my images aint png files?

18
General / help!! Loading bitmap error in sfml 2.0 :(
« on: October 21, 2012, 12:58:09 am »
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
        sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "Title");

        sf::Texture mytexture;
        sf::Sprite mysprite;

        mytexture.loadFromFile("theimage.bmp");

        mysprite.setTexture(mytexture, 0);

        while (Window.isOpen())
        {
                sf::Event Event;
                while(Window.pollEvent(Event))
                {
                        if(Event.type == sf::Event::Closed || Event.key.code == sf::Keyboard::Escape)
                                Window.close();
                }

                Window.clear();
                Window.draw(mysprite);
                Window.display();
                sf::sleep(sf::milliseconds(60));

        }

        return 0;
}

I cant really seem to figure it out when i look in the documentation  :(
When i run it, it gives me those "dot" sounds every 0.4 sec, and then there come a box where there stand i can break, continue or ignore.
In the console window there stand "failed to load image".

I have put the image in the folder where my .cpp is.

19
General / A little confused in the "Getting started" Tutorial
« on: October 08, 2012, 01:21:29 am »
http://sfml-dev.org/tutorials/2.0/start-vc.php

At the buttom of the page, the little test, i got everything to work.

But im confused about the nested while-loop

it looks like to me that the nested-while-loop is like an if-statement, because it go in and do the thing 1 single time, and then jump out of the loop again. I know it because i tested it with the cout thing inside the first while-loop, and it looped around 24/7.

Why not just make it to an if-statement? That would seem less confusing because then you know for sure it will do the statement 1 single time and jump out.

i actually tried to replace "while" with "if" and it worked perfectly, but why make it to a while-loop and why does it jump out?

Pages: 1 [2]