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

Pages: [1] 2
1
Graphics / Re: Gradient Rectangle
« on: August 21, 2014, 06:02:12 pm »
Hmm okay so that alone works, but not if
sf::Vertex backgroundgr[4];
is set in header?

And if I just put
sf::Vertex backgroundgr[4] =
        {
                sf::Vertex(sf::Vector2f(0, 0), sf::Color::Blue),
                sf::Vertex(sf::Vector2f(0, 1280), sf::Color::Blue),
                sf::Vertex(sf::Vector2f(720, 1280), sf::Color::Cyan),
                sf::Vertex(sf::Vector2f(720, 0), sf::Color::Cyan),
        };
in the .cpp it says: backgroundgr : undeclared identifier

2
Graphics / Re: Gradient Rectangle
« on: August 21, 2014, 05:37:17 pm »
FINE YA DINGUS, for you, because you're nice. Not for G...
#include <memory>
#include <iostream>

#include "StateMachine.hpp"
#include "Level1State.hpp"
#include "PlayState.hpp"
#include "GameState.hpp"
#include "StateMachine.hpp"
#include "MenuState.hpp"
#include "Application.hpp"

#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/Window/Event.hpp>

int main() {
    sf::RenderWindow window( sf::VideoMode(1280, 720, 32), "Vieze kut" );
        sf::Vertex backgroundgr[] =
        {
                sf::Vertex(sf::Vector2f(0, 0), sf::Color::Blue),
                sf::Vertex(sf::Vector2f(0, 1280), sf::Color::Blue),
                sf::Vertex(sf::Vector2f(720, 1280), sf::Color::Cyan),
                sf::Vertex(sf::Vector2f(720, 0), sf::Color::Cyan),
        };
       
    while( window.isOpen() ) {
        sf::Event event;
        while( window.pollEvent( event ) ) {
            if( event.type == sf::Event::Closed ) {
                window.close();
            }
        }

                window.clear();
                window.draw(backgroundgr, 4, sf::Quads);
        window.display();
    }

    return EXIT_SUCCESS;
}

3
Graphics / Re: Gradient Rectangle
« on: August 21, 2014, 05:14:24 pm »
Kay thanks, but it didn't fix the problem.

4
Graphics / Re: Gradient Rectangle
« on: August 20, 2014, 10:35:37 pm »
Well I guess it's not worth for you to come back then.

5
Graphics / Re: Gradient Rectangle
« on: August 20, 2014, 09:47:04 pm »
Uhm 1280 x 720, but even with 720, 1280 it should at least be drawn for a bit.

6
Graphics / Re: Gradient Rectangle
« on: August 20, 2014, 09:35:09 pm »
Yep, both. Just thought those were too obvious to show it to you ;)

7
Graphics / Gradient Rectangle
« on: August 20, 2014, 09:26:04 pm »
I was searching for how to use gradient, then I found this: http://en.sfml-dev.org/forums/index.php?topic=6750.0
I tried the code that laurent provided but it doesn't work. No errors, just a black screen.
Pieces of code in question:
sf::Vertex backgroundgr[] =
        {
                sf::Vertex(sf::Vector2f(0, 0), sf::Color::Blue),
                sf::Vertex(sf::Vector2f(0, 1280), sf::Color::Blue),
                sf::Vertex(sf::Vector2f(720, 0), sf::Color::Cyan),
                sf::Vertex(sf::Vector2f(720, 1280), sf::Color::Cyan)
        };

m_window.draw(backgroundgr, 4, sf::Quads);
Now, I don't know if I'm using it wrong, or if it just doesn't work.  :-\

8
General / Re: Switching 'scenes'
« on: August 20, 2014, 08:12:24 pm »
Uhm I really have NO IDEA what i did, but it works now :|
Thanks for your help though.

9
General / Re: Switching 'scenes'
« on: August 20, 2014, 08:03:49 pm »
I know what SSCCE is, I just can't do it.
And uhm they are going to be a bit more than 40 lines, so I put them on pastebin. (I hope it is allowed here)
OptionsMenuState.hpp http://pastebin.com/Lxt7BHdG
OptionsMenuState.cpp http://pastebin.com/JdN7iwCM
I removed everything that I thought was unnecessary.

10
General / Re: Switching 'scenes'
« on: August 20, 2014, 07:49:53 pm »
How about asking for information?
And at least now I got you people's attention again.

-
Displaying arrogant? That's an opinion because I don't think it displays arrogant at all, I'm just saying what my brain wants me to.
And what parts of the code should I upload? Because I have no idea what you want to look at then.

And the reason that I didn't give any info was because I'm fairly new to C++, and I thought that I might give you guys the wrong information. For example if I give you A, you need to see B

11
General / Re: Switching 'scenes'
« on: August 20, 2014, 07:34:46 pm »
Okay fine, thanks for not even helping me anymore. Jesus, what a community...

12
General / Re: Switching 'scenes'
« on: August 19, 2014, 02:44:59 pm »
It was also useful for me and I also thanked you. Yet you're not glad it was useful for me  >:(

And there are many more ways to learn programming than reading books.
And I renamed everything correctly, 100% sure.

13
General / Re: Switching 'scenes'
« on: August 18, 2014, 10:24:30 pm »
 I don't read books.

What I did was I basically copied everything from PlayState.cpp and .hpp but renamed everything that had to be renamed.
So I really don't know where I went wrong.

14
General / Re: Switching 'scenes'
« on: August 18, 2014, 08:06:10 pm »
Okay, let me tell you this. I know HTML, CSS, PHP, Java, JavaScript, Python. I know how programming languages work. And it is obvious that if you put "1" in "1.hpp" and if you need it, you need to include "1.hpp". That's obvious. In many languages. But I have looked through every file, but I cannot find it. At all.
Because there is nothing where a state such as "IntroState" is made.

15
General / Re: Switching 'scenes'
« on: August 18, 2014, 06:57:07 pm »
I do have 2 problems with it:
1) I want to make a new 'state' but I get the error: "OptionsMenuState" : undeclared identifier

2) m_next = StateMachine::build<PlayState>(m_machine, m_window, false);
works from IntroState.cpp, but not from another script.

Pages: [1] 2