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

Pages: [1]
1
Thanks, I get the part about drawing onto the default viewport, but when I try to draw it into the the small view, the mapview if you will I do this:

#include "app.h"

void App::Loop(){
        // Clear previous view first.
        gameScreen.clear(sf::Color(24, 24, 24));
        // Set map view
        gameScreen.setView(mapView);
        playerChar.setPosition(x, y);
        gameScreen.draw(playerChar);
        // Set interface view
        gameScreen.setView(fullView);
}

Nothing seems to print at all?

And even if I switch the order of view's, it doesn't work?
#include "app.h"

void App::Loop(){
        // Clear previous view first.
        gameScreen.clear(sf::Color(24, 24, 24));
        // Set interface view
        gameScreen.setView(fullView);
        // Set map view
        gameScreen.setView(mapView);
        playerChar.setPosition(x, y);
        gameScreen.draw(playerChar);
}

2
I was on linux and I got it compiled, installed static stuff to rule out future installing on windows and shared libs as well. I also managed to port my code in under 15 minutes, really easy, although can you @FRex, can you tell me what specific functionality how to use it for what I need with the window?

3
Wow, thank's, that's much better, I got rather confused before, I'll do that now, and just port my maybe 10~15 lines of code in SFML over...

4
I should, but I already had 1.6 done and didn't want to set up 2.0. Besides 1.6 is much easier to install :p

5
So, initially I thought that sf::View just made a region in the app where stuff was rendered, leaving everything else outside it unaffected. But turns out it just seems to zoom in and focus on the region. How can I only display stuff in a certain region like so?



Essentially I want the scale for everything to be the same, but say I blit a map to the screen, the portion in the green should be visible, everything else should be hidden, and then the light blue area will/can be used for other stuff.

How can I do this?

6
Window / Re: [1.6] How to disable resizing SFML window.
« on: March 31, 2013, 05:39:25 pm »
Wow, thanks! The last/second one worked perfectly. Thanks for the help.

7
Window / Re: [1.6] How to disable resizing SFML window.
« on: March 31, 2013, 05:15:27 pm »
I do that but I get the following error:

app.cpp:5: error: no matching function for call to ‘sf::Window::Create(sf::VideoMode, const char [11], int, int)
/usr/local/include/SFML/Window/Window.hpp:100: note: candidates are: void sf::Window::Create(sf::VideoMode, const std::string&, long unsigned int, const sf::WindowSettings&)
/usr/local/include/SFML/Window/Window.hpp:109: note:                 void sf::Window::Create(sf::WindowHandle, const sf::WindowSettings&)
 

Seems to say that calling the function like that is incorrect?

8
Window / [1.6] How to disable resizing SFML window.
« on: March 31, 2013, 03:43:57 am »
So, I want to be able to disable resizing the SFML window and tried to do it using the following code I found:

gameScreen.Create(sf::VideoMode(800, 600), "Lazeroids!", sf::Style::Resize, 0);
although this doesn't seem to work at all. Am I missing something?

P.S. If I'm making an asteroids game, would it be better to disable resizing, or just change the view, and if the view, how would I do it?

9
General / Re: [SFML 1.6] Functions don't exist in sf::Window?
« on: March 26, 2013, 05:38:08 pm »
Kinda what I'm asking, how do I pass it, I have no idea? the code I posted last message doesn't work. what is the proper way?

10
General / Re: [SFML 1.6] Functions don't exist in sf::Window?
« on: March 26, 2013, 01:18:31 am »
Oh, okay. That did the trick, although can you answer my question, is there any way I can pass an event via a function? So my Event function can handle them? I tried getting it via

int Event(sf::Event*){...}
although that doesn't seem to work.

11
General / [SFML 1.6] Functions don't exist in sf::Window?
« on: March 26, 2013, 12:34:30 am »
So, I'm kind-of new to SFML, and have been using it for a few days. I got the examples working, so I know libraries work. I'm on Debian 6.0 (Sqeeze). I'm working on the event's section of the SFML, and it keeps saying it does not exist (the functions).

This is my header file.
#ifndef _APP_H_
#define _APP_H_

#include <SFML/System.hpp>
#include <SFML/Window.hpp>

class App{
        private: // Here is the Game Stuff
                sf::Window gameScreen;
        public: // Game Starting Methods
                App();
                int Execute();
                // Game Loop Methods
                bool Init();
                void Event();
                void Loop();
                void Render();
                void Cleanup();
};

#endif

And this is the main problem file:
#include "app.h"

App::App(){
        // Set up basic game stuff.
        gameScreen.Create(sf::VideoMode(800, 600), "Lazeroids!");
}

int App::Execute(){
        if (Init() == false)
                return -1;
        sf::Event event;
        while(gameScreen.isOpen()){
                while(gameScreen.pollEvent(event)){
                        Event();
                }
                Loop();
                Render();
        }
        Cleanup();
        return 0;
}

int main(int argc, char *argv[]){
        // Create the actual game object.
        // Only 3 lines here.
        // Oh, and don't forgot to call the game to run.
        App game;
        return game.Execute();
}

The problem is in the section of code that has these lines:
while(gameScreen.isOpen()){
                while(gameScreen.pollEvent(event)){
                        Event();
                }

The error comes up saying:
app.cpp: In member function ‘int App::Execute()’:
app.cpp:12: error: ‘class sf::Window’ has no member named ‘isOpen’
app.cpp:13: error: ‘class sf::Window’ has no member named ‘pollEvent’

I've tried a few different function capitalization ways, and even included <SFML/Event.hpp> (Which doesn't seem to exist?)

What am I doing wrong.

P.S. How would I have a function that accepts an event? (Like in the arguments)

Pages: [1]