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

Pages: [1]
1
Graphics / SFML2 rendering sprites fail.
« on: June 22, 2011, 07:49:19 pm »
honestly, I get this issue all the damn time. what in the hell do i have to do to get a sprite on the screen every single time! i just get a white block of whats supposed to be the image. yes i've used sfml before and this issue is random. some projects i have them working fine. this they dont.

heres the code:

Code: [Select]


#include <SFML/Graphics.hpp>
#include"Background.hpp"

int main()
{
    // Create the main window-width, hieght
    sf::RenderWindow window(sf::VideoMode(800, 600), "Connect 4");

    window.SetFramerateLimit(15);
    //load images
    sf::Sprite background(Background::Load("Data/background.bmp"));
    background.Move(200,200);
    // Start the game loop
    while (window.IsOpened())
    {
        // Process events
        sf::Event event;
        while (window.PollEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
                window.Close();
        }

        // Clear screen
        window.Clear();

        window.Draw(background);
        // Update the window
        window.Display();
    }

    return EXIT_SUCCESS;
}


all background does is return the sprite loaded.

Code: [Select]

sf::Image Background::Load(string filename)
{
    sf::Image image;

    if( !image.LoadFromFile(filename) )
    {
        //fail
    }
    else
    {
        return image;
    }
}


2
General discussions / The Concept of Screen moving [2d camera]
« on: June 10, 2011, 05:46:27 pm »
Hello, i've been wondering this but i can seem to get a hold of the concept of programming a 2d platformer. jumping and maps dont seem to be the problem its just the screen( or camera) moving i dont understand. can someone break down the theory of this. do i need an offset, becasue i heard one way of doing it is basically the character doesnt move at all but you essentially moving the map itself.

3
General / [Solved] Creating Packages for Linux
« on: June 07, 2011, 05:20:07 pm »
hello you guys, i am new to linux and i was wondering how do i get my program i built to install to the system. i want to learn how to create a packages (.deb & .rpm) for my game. i understand how to use makefiles but "configure" is something i dont understand.  which package manager is easier to use?

Pages: [1]
anything