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

Pages: [1]
1
General discussions / Re: Game lifecycle - Best practice for drawing?
« on: July 22, 2012, 01:37:17 pm »
Thank your very much!
This was quite helpful ;)

2
General discussions / Game lifecycle - Best practice for drawing?
« on: July 22, 2012, 12:23:34 pm »
Hi,

I'm about to program a pong-clon to get some skills for bigger projects
I'm asking me what's the best practice when it comes up to drawing all the stuff I want to have in the game?

I can't believe I should put all the code in the main loop

I thought about the following approach:
(not tested)
#include <SFML/Graphics.hpp>
#include "Game.h"

int main()
{
        sf::RenderWindow window(sf::VideoMode(800, 600), "Pong");
        Game *game = new Game( &window );

        while (window.isOpen())
        {
                sf::Event event;
                while (window.pollEvent(event))
                {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear();
                game->start();
                window.display();
        }

        return 0;
}

any suggestions?


Edit: sf::NonCopyable::NonCopyable
I guess this approach doesn't work... :)

3
General / SFML2.0 - fatal error LNK1107
« on: December 07, 2011, 01:44:45 pm »
Oh
my
god.

This was indeed a newbie mistake ;)
Thanks for your fast reply! ATI bug (as expected) is also fixed now. :)

4
General / SFML2.0 - fatal error LNK1107
« on: December 07, 2011, 01:03:33 pm »
Hi everybody!

I'm trying to compile my project with SFML2.0 (have compiled SFML2.0 with Visual Studio 9)

Before that, I've used SFML 1.6 but I'm a victim of the ATI bug ;)

I think I've compiled it correctly (SFML 2.0) but when I'm trying to compile my project, I'm getting
Quote
sfml-graphics-d-2.dll : fatal error LNK1107: Invalid or corrupted File: Read at 0x2E0 not possible.


How I compiled SFML2.0
- CMAKE
-- Build Examples
-- Build Shared Libs
-- Type: Release
- Visual Studio 9
-- Compiled "ALL_BUILD"
-- Compiled "INSTALL"

How I've implemented it into Visual Studio 9
- Added lib, include & src path to Visual Studio 9
- Added .dll files to my Project (Linker/Input)
- Copied the .dll into my project folder

Any newbie mistakes so far? :P

p.s.: I've used some tutorial code for testing sfml 2.0

Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}

Pages: [1]