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

Pages: [1]
1
General / Re: Lethn's Programming Questions Thread
« on: August 08, 2013, 10:23:59 am »
*currently reading through variables and basic types*

...

If you'd like videos instead (I know I do), I started out learning programming through xoax. The videos are a bit sleep-inducing but still good.

2
General / Re: Menu Systems in Games
« on: August 08, 2013, 10:11:50 am »
There is actually a post on the wiki just for this! I haven't actually read it through but I assume it's up to par.
Here's the link

3
General / Re: Help with a switch statement
« on: August 06, 2013, 05:33:17 pm »
I have no idea if you can use || inside a switch like that...

Here is a snippet from my main-loop. Note that I wrote the class "Input" myself but you could always use sf::Keyboard::isKeyPressed() or something else.

    while(window.isOpen())
        {
                Input::Update();

                sf::Event event;

                while(window.pollEvent(event))
                {
                        switch (event.type)
                        {
                        case sf::Event::Closed:
                                window.close();
                                break;
                        case sf::Event::KeyPressed:
                                if(hasFocus)
                                        if(Input::KeyDown(sf::Keyboard::Escape))
                                                window.close();
                                break;
                        case sf::Event::LostFocus:
                                hasFocus = GL_FALSE;
                                break;
                        case sf::Event::GainedFocus:
                                hasFocus = GL_TRUE;
                                break;
                        case sf::Event::TextEntered:
                                if(event.text.unicode <= 255)
                                        console.AppendText(static_cast<GLubyte>(event.text.unicode));
                                break;
                        default:
                                break;
                        }
                }

Pages: [1]