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

Pages: [1] 2
1
Graphics / Subtract Polygons From Polygons(Create Concave Shape)
« on: February 18, 2015, 08:40:18 pm »
Hi,
I am trying to create a concave shape. As SFML does not support concave shapes, I can create a "hull" that encompasses the concave shape. I then look at the points that are not on the hull and create a triangle consisting of the point, a point on the hull to the left, and a point on the hull to the right. This will make a triangle that is the hole (the concave part of the polygon). Once I have all the holes, I want to subtract them from the "hull" and get my final polygon. How can I do the subtracting step? Is that even possible?

As a side note, I would then draw that shape to a sf::RenderTexture which  I would apply a light/glow fragment shader in order to create dynamic shadow light. Is that the proper way to do such a thing?

If anyone is wondering, this is what I am trying to create the polygon for: http://ncase.me/sight-and-light/

Thanks!

2
Graphics / Re: "True" global bounds (or position) of text
« on: December 25, 2014, 06:06:40 am »
Quote
Sorry, I should rephrase my question, I kinda worded it awkwardly
Your question was very clear. I should rather rephrase my answer (although I think it was clear enough too ;)): your code doesn't use the left / top coordinates. It should.

Ohhhhhhhh...derp. Thanks! That solves the issue!  ;D

3
Graphics / Re: "True" global bounds (or position) of text
« on: December 24, 2014, 07:43:21 pm »
This question has been asked hundreds of times. The text bounds don't only contain a width and a height, but also a left and a top coordinate. In case of sf::Text, these are not zero.

Sorry, I should rephrase my question, I kinda worded it awkwardly. I am aware that there is a .left and a .top. My problem is that with the code that I listed, the selection rectangle should cover the whole text but it doesn't. I am wondering if there is something I am doing wrong. 

4
Graphics / [SOLVED] "True" global bounds (or position) of text
« on: December 24, 2014, 08:01:58 am »
Hey guys!

Hope you don't find my recent flood of questions.  :P

Anyways, I was wondering if there is a way to get the "true" global bounds of an sf::Text. What I mean is that when I use the following code, the rectangle doesn't cover the text completely:

playText_.setOrigin(sf::Vector2f(playText_.getLocalBounds().width / 2.0f, playText_.getLocalBounds().height / 2.0f));

selectionRect_.setSize(sf::Vector2f(playText_.getGlobalBounds().width, playText_.getGlobalBounds().height));
selectionRect_.setOrigin(sf::Vector2f(selectionRect_.getSize().x / 2.0f, selectionRect_.getSize().y / 2.0f));
selectionRect_.setPosition(playText_.getPosition());




Do you guys see what I mean? Is there any way around this issue?

EDIT: Now that I look at it, it looks like it is just offset to the top left... However, the origins are at the center so is there any way that can happen?

5
Graphics / Re: Access violation on certain attributes of sf::Text [C++]
« on: December 24, 2014, 06:11:30 am »
Nevermind. I didn't find a solution but the whole reason this was even a problem is because I tried to refit this for something it wasn't. I reverted to a commit earlier today. Hope someone wasn't typing the solution right as I post this...

6
Graphics / Access violation on certain attributes of sf::Text [C++]
« on: December 24, 2014, 03:30:46 am »
Hey,

So this time hopefully my issue isn't as stupid as me adding an extra semi-colon, but when I try to get the global bounds of an sf::Text object, I get an access violation:

First-chance exception at 0x0FD2E41F (sfml-graphics-d-2.dll) in Survive.exe: 0xC0000005: Access violation reading location 0xCCCCCD24.

The violation happens in the if statement when I use the .contains method(). I know it happens because of the .getGlobalBounds() method because if I try std::cout'ing that value's width, height, etc, it will crash there instead.

Here are my .h and .cpp files. The relevent .h portion is the  //------Menu---- and //=====Main Screen==== section. As for the .cpp, the menu constructor is the one that loads. As an added note, even though I change the character size, Visual Studio is reporting it as '0' in the debug window at the time of the crash. Thanks!

.h

#ifndef GUIMANAGER_H
#define GUIMANAGER_H
#include <SFML/Graphics.hpp>
#include "Player.h"
class GUIManager
{
public:
        GUIManager(sf::RenderWindow*, Player*);
        GUIManager(sf::RenderWindow*);
        GUIManager();
        void update(const sf::Time&);

        enum menuType
        {
                main,
                settings,
                gameplay,
                audio,
                controls
        };

        //Getters
        sf::RectangleShape getHealthOutOf() const;
        sf::RectangleShape getHealthCurrent() const;
        sf::RectangleShape getReloadOutOf() const;
        sf::RectangleShape getReloadCurrent() const;
        sf::Text getTotalAmmo() const;
        bool isMenu() const;
        menuType getCurrentMenu() const;
        sf::RectangleShape getSelectionRect() const;
        sf::Text getSurviveTitleText() const;
        sf::Text getPlayText() const;
        sf::Text getSettingsText() const;
        sf::Text getQuitText() const;

       


private:
        sf::RenderWindow* pWindow_;
        sf::Font font_;
        bool menu_;
       

        //-----------------------------------MENU------------------------------------
        //The type of menu that is currently visible
        menuType currentMenu_ = main;
        //Rectangle that appears below selected button/text
        sf::RectangleShape selectionRect_;
        //Text that is shown at the bottom to describe what the setting does
        sf::Text descriptionText_;
        //The sizes of selectable buttons and title texts in percent
        int titleSize_ = 0.3f;
        int buttonSize_ = 0.1f;

        float titleOffset_ = 0.15f;
        //==================================Main Screen===================================

        //Text
        sf::Text surviveTitleText_;
        sf::Text playText_;
        sf::Text settingsText_;
        sf::Text quitText_;

        //====================================Settings====================================

        sf::Text settingsTitleText_;
        sf::Text audioText_;
        sf::Text gameplayText_;
        sf::Text fullscreenText_;

        //====================================GAMEPLAY====================================
        sf::Text gameplayTitleText_;
        sf::Text mapSizeText_;
        sf::Text difficultyMultiplierText_;



        //--------------------------------------Game--------------------------------------
        Player* pPlayer_;

        //Health
        sf::RectangleShape healthOutOf_;
        sf::RectangleShape healthCurrent_;
        sf::Vector2f healthOffset_ = sf::Vector2f(0.01f, 0.01f); //In percent of window size
        sf::Vector2f healthSize_ = sf::Vector2f(0.075f, 0.01f); //In percent of window size

        //Weapon
        sf::Text ammo_;
        sf::Vector2f ammoOffset_ = sf::Vector2f(0.015f, 0.015f);
        float ammoSize_ = 0.035f; //In percent

        //Reload
        sf::RectangleShape reloadOutOf_;
        sf::RectangleShape reloadCurrent_;
        sf::Vector2f reloadOffset_ = sf::Vector2f(0.01f, 0.01f);
        sf::Vector2f reloadSize_ = sf::Vector2f(0.075f, 0.01f);

};

#endif 

.cpp

#include "GUIManager.h"
#include <iostream>
#include "Humanoid.h"
#include "Player.h"
#include "Gun.h"

//HUD constructor
GUIManager::GUIManager(sf::RenderWindow* pWindow, Player* pPlayer)
        :pWindow_(pWindow), pPlayer_(pPlayer)
{


        if (!font_.loadFromFile("arial.ttf"))
                std::cout << "Failed to load font." << std::endl;

        //Health
        healthOutOf_.setFillColor(sf::Color(214, 34, 34));
        healthCurrent_.setFillColor(sf::Color(78, 213, 116));
        healthOutOf_.setSize(sf::Vector2f(3.0f, 3.0f));
        healthCurrent_.setSize(sf::Vector2f(3.0f, 3.0f));
        healthOutOf_.setOrigin(0.0f, 3.0f);
        healthCurrent_.setOrigin(0.0f, 3.0f);

        //Ammo
        ammo_.setFont(font_);
        ammo_.setColor(sf::Color::Black);

        //Reload
        reloadOutOf_.setFillColor(sf::Color(23, 24, 25));
        reloadCurrent_.setFillColor(sf::Color(141, 191, 215));
        reloadCurrent_.setSize(sf::Vector2f(3.0f, 3.0f));
        reloadOutOf_.setSize(sf::Vector2f(3.0f, 3.0f));
        reloadCurrent_.setOrigin(sf::Vector2f(3.0f, 3.0f));
        reloadOutOf_.setOrigin(sf::Vector2f(3.0f, 3.0f));
}

//Menu constructor
GUIManager::GUIManager(sf::RenderWindow* pWindow)
        :menu_(true), pWindow_(pWindow)
{


        if (!font_.loadFromFile("arial.ttf"))
                std::cout << "Failed to load font." << std::endl;
        selectionRect_.setFillColor(sf::Color(200, 200, 200, 100));
        selectionRect_.setPosition(sf::Vector2f(-10000.0f, -10000.0f));

        surviveTitleText_.setFont(font_);
        playText_.setFont(font_);
        settingsText_.setFont(font_);
        quitText_.setFont(font_);

        //Assigns all the strings to the texts
        surviveTitleText_.setString("Survive");
        playText_.setString("Play");
        settingsText_.setString("Settings");
        quitText_.setString("Quit");
        settingsTitleText_.setString("Settings");
        audioText_.setString("Audio");
        gameplayText_.setString("Gameplay");
        fullscreenText_.setString("Fullscreen: No");
        gameplayTitleText_.setString("Gameplay");
        mapSizeText_.setString("Map Size: 257");
        difficultyMultiplierText_.setString("Difficulty: Easy");

       
}

//Default - do not use
GUIManager::GUIManager()
{
}

void GUIManager::update(const sf::Time& dT)
{
        sf::Vector2f windowSize = pWindow_->getView().getSize();

        if (menu_)
        {
                if (currentMenu_ == main)
                {
                        surviveTitleText_.setCharacterSize((int)(titleSize_ * windowSize.y));
                        playText_.setCharacterSize((int)(buttonSize_ * windowSize.y));
                        settingsText_.setCharacterSize((int)(buttonSize_ * windowSize.y));
                        quitText_.setCharacterSize((int)(buttonSize_ * windowSize.y));
                        std::cout << settingsText_.getPosition().x;

                        surviveTitleText_.setPosition(windowSize.x / 2.0f, windowSize.y * titleOffset_);
                        playText_.setPosition(windowSize.x / 2.0f, windowSize.y * titleOffset_ + windowSize.y * 0.15f * 2);
                        settingsText_.setPosition(windowSize.x / 2.0f, windowSize.y * titleOffset_ + windowSize.y * 0.15f * 3);
                        quitText_.setPosition(windowSize.x / 2.0f, windowSize.y * titleOffset_ + windowSize.y * 0.15f * 4);

               
                        if (playText_.getGlobalBounds().contains((sf::Vector2f)sf::Mouse::getPosition(*pWindow_)))
                        {
                                selectionRect_.setSize(sf::Vector2f(playText_.getGlobalBounds().width, playText_.getGlobalBounds().height));
                                selectionRect_.setPosition(playText_.getPosition());
                        }
                        else if (settingsText_.getGlobalBounds().contains((sf::Vector2f)sf::Mouse::getPosition(*pWindow_)))
                        {
                                selectionRect_.setSize(sf::Vector2f(settingsText_.getGlobalBounds().width, settingsText_.getGlobalBounds().height));
                                selectionRect_.setPosition(settingsText_.getPosition());
                        }
                        else if (quitText_.getGlobalBounds().contains((sf::Vector2f)sf::Mouse::getPosition(*pWindow_)))
                        {
                                selectionRect_.setSize(sf::Vector2f(quitText_.getGlobalBounds().width, quitText_.getGlobalBounds().height));
                                selectionRect_.setPosition(quitText_.getPosition());
                        }
                }

        }
        else
        {
                sf::Vector2f currentWindowPos(pWindow_->getView().getCenter().x - windowSize.x / 2.0f, pWindow_->getView().getCenter().y - windowSize.y / 2.);
                //Health
                healthOutOf_.setScale(windowSize.x * healthSize_.x, windowSize.y * healthSize_.y);
                healthCurrent_.setScale(windowSize.x * healthSize_.x * (pPlayer_->getHealth() / 100.0f), windowSize.y * healthSize_.y);
                healthOutOf_.setPosition(currentWindowPos.x + windowSize.x * healthOffset_.x, currentWindowPos.y + windowSize.y - windowSize.y * healthOffset_.y);
                healthCurrent_.setPosition(currentWindowPos.x + windowSize.x * healthOffset_.x, currentWindowPos.y + windowSize.y - windowSize.y * healthOffset_.y);

                //Reload
                Gun gun = pPlayer_->getGuns().at(pPlayer_->getCurrentGunIndex());
                if (gun.isReloading())
                        reloadCurrent_.setScale(windowSize.x * reloadSize_.x * (gun.getCurrentReloadTime().asSeconds() / gun.getReloadTime()), windowSize.y * reloadSize_.y);
                else
                        reloadCurrent_.setScale(windowSize.x * reloadSize_.x * (gun.getCurrentBullets() / (float)gun.getBulletsPerMag()), windowSize.y * reloadSize_.y);

                reloadOutOf_.setScale(windowSize.x * reloadSize_.x, windowSize.y * reloadSize_.y);
                reloadCurrent_.setPosition(currentWindowPos.x + windowSize.x - windowSize.x * reloadOffset_.x, currentWindowPos.y + windowSize.y - windowSize.y * reloadOffset_.y);
                reloadOutOf_.setPosition(currentWindowPos.x + windowSize.x - windowSize.x * reloadOffset_.x, currentWindowPos.y + windowSize.y - windowSize.y * reloadOffset_.y);

                //Ammo
                ammo_.setString(std::to_string(pPlayer_->getGuns().at(pPlayer_->getCurrentGunIndex()).getCurrentBullets()) + " / " + std::to_string(pPlayer_->getGuns().at(pPlayer_->getCurrentGunIndex()).getTotalAmmo()));
                ammo_.setOrigin(ammo_.getLocalBounds().width / 2, ammo_.getLocalBounds().height / 2.0f);
                ammo_.setCharacterSize(0.75f * reloadOutOf_.getGlobalBounds().height);
                ammo_.setPosition(reloadOutOf_.getPosition().x - reloadOutOf_.getGlobalBounds().width / 2.0f, reloadOutOf_.getPosition().y - reloadOutOf_.getGlobalBounds().height / 2.0f);
        }
}

//Getters
sf::RectangleShape GUIManager::getHealthOutOf() const { return healthOutOf_; }
sf::RectangleShape GUIManager::getHealthCurrent() const { return healthCurrent_; }
sf::RectangleShape GUIManager::getReloadOutOf() const { return reloadOutOf_; }
sf::RectangleShape GUIManager::getReloadCurrent() const { return reloadCurrent_; }
sf::Text GUIManager::getTotalAmmo() const { return ammo_; }
bool GUIManager::isMenu() const { return menu_; }
sf::RectangleShape GUIManager::getSelectionRect() const { return selectionRect_; }
sf::Text GUIManager::getSurviveTitleText() const { return surviveTitleText_; }
sf::Text GUIManager::getPlayText() const { return playText_; }
sf::Text GUIManager::getSettingsText() const { return settingsText_; }
sf::Text GUIManager::getQuitText() const { return quitText_; }

7
Graphics / Re: Font is failing to load
« on: December 23, 2014, 04:58:21 am »
You need to remove the semicolon after your "if" statement otherwise you will always get that error message! 
if(!font_.loadFromFile("arial.ttf"));// The problem is here! Remove the semicolon!
        std::cout << "Failed to load font." << std::endl;
 

I...I don't even know how I managed to do that, lol. Thanks.

8
Graphics / Font is failing to load
« on: December 23, 2014, 03:15:28 am »
Hey!

I have the following code:
if(!font_.loadFromFile("arial.ttf"));
        std::cout << "Failed to load font." << std::endl;

I have the following file structure:


The end result is one of pain and suffering(look at the console):


Does anyone know why this is happening? The font is in the same directory as the exe. Thanks!

9
Audio / Re: Audio cuts out or doesn't play at all [c++]
« on: December 21, 2014, 06:32:15 am »

The solution is to use storage that gets left alone, such as a std::list.

Also, use .back() rather than .at(.size() - 1)

Thanks! That fixed it!

Quote
By the way, your update functions is quite inefficient. You'd better use the erase-remove idiom.

Cool, I didn't know that those were actually more efficient. I just thought they were convenient.

EDIT: I actually can't use std::remove  because it will end up causing the same problem we just fixed because it reorganizes the list. I had to revert that part.

10
Audio / Audio cuts out or doesn't play at all [c++]
« on: December 20, 2014, 10:02:54 pm »
Hi,
I am trying to set up my audio system, however it seems to cut out early or sometimes not play at all. Do you guys see anything wrong with my set up?

#ifndef SOUNDMANAGER_H
#define SOUNDMANAGER_H
#include <SFML/Audio.hpp>
#include <SFML/System.hpp>
#include <vector>
class SoundManager
{
public:
    SoundManager();
    void playSound(const std::string&);
    void update(const sf::Time&);
private:
   
    //------------------Buffers-----------------------
    //Pistol
    sf::SoundBuffer bufferPistolOne_;
    sf::SoundBuffer bufferPistolTwo_;
    sf::SoundBuffer bufferPistolThree_;
   
    //Rifle
    sf::SoundBuffer bufferRifleOne_;
    sf::SoundBuffer bufferRifleTwo_;
    sf::SoundBuffer bufferRifleThree_;
    sf::SoundBuffer bufferRifleFour_;
   
    //Grass footsteps
    sf::SoundBuffer bufferGrassOne_;
    sf::SoundBuffer bufferGrassTwo_;
    sf::SoundBuffer bufferGrassThree_;
    sf::SoundBuffer bufferGrassFour_;
    sf::SoundBuffer bufferGrassFive_;
    sf::SoundBuffer bufferGrassSix_;
    sf::SoundBuffer bufferGrassSeven_;
   
    std::vector<sf::Sound> vSounds_;
   
   
   
   
};

#endif

 


#include "SoundManager.h"
#include <iostream>
SoundManager::SoundManager()
{
    //----------------Loads all of the sounds--------------
    //Pistol
    if(!bufferPistolOne_.loadFromFile("sounds/gun/pistol/pistol_1.ogg"))
        std::cout << "Failed to load: sounds/gun/pistol/pistol_1.ogg" << std::endl;
   
    if(!bufferPistolTwo_.loadFromFile("sounds/gun/pistol/pistol_2.ogg"))
        std::cout << "Failed to load: sounds/gun/pistol/pistol_2.ogg" << std::endl;

    if(!bufferPistolThree_.loadFromFile("sounds/gun/pistol/pistol_3.ogg"))
        std::cout << "Failed to load: sounds/gun/pistol/pistol_3.ogg" << std::endl;

    //Rifle
    if(!bufferRifleOne_.loadFromFile("sounds/gun/rifle/rifle_1.ogg"))
        std::cout << "Failed to load: sounds/gun/rifle/rifle_1.ogg" << std::endl;

    if(!bufferRifleTwo_.loadFromFile("sounds/gun/rifle/rifle_2.ogg"))
        std::cout << "Failed to load: sounds/gun/rifle/rifle_2.ogg" << std::endl;
   
    if(!bufferRifleThree_.loadFromFile("sounds/gun/rifle/rifle_3.ogg"))
        std::cout << "Failed to load: sounds/gun/rifle/rifle_3.ogg" << std::endl;

    if(!bufferRifleFour_.loadFromFile("sounds/gun/rifle/rifle_4.ogg"))
        std::cout << "Failed to load: sounds/gun/rifle/rifle_4.ogg" << std::endl;

   
    //Grass
    if(!bufferGrassOne_.loadFromFile("sounds/footstep/grass/grass_1.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_1.ogg" << std::endl;

    if(!bufferGrassTwo_.loadFromFile("sounds/footstep/grass/grass_2.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_2.ogg" << std::endl;

    if(!bufferGrassThree_.loadFromFile("sounds/footstep/grass/grass_3.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_3.ogg" << std::endl;

    if(!bufferGrassFour_.loadFromFile("sounds/footstep/grass/grass_4.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_4.ogg" << std::endl;

    if(!bufferGrassFive_.loadFromFile("sounds/footstep/grass/grass_5.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_5.ogg" << std::endl;

    if(!bufferGrassSix_.loadFromFile("sounds/footstep/grass/grass_6.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_6.ogg" << std::endl;

    if(!bufferGrassSeven_.loadFromFile("sounds/footstep/grass/grass_7.ogg"))
        std::cout << "Failed to load: sounds/footstep/grass/grass_7.ogg" << std::endl;


}
void SoundManager::update(const sf::Time& dT)
{
    for(auto iSound = vSounds_.begin(); iSound != vSounds_.end();)
        if(iSound->getStatus() == sf::Sound::Stopped)
            iSound = vSounds_.erase(iSound);
        else
            ++iSound;
   
}
void SoundManager::playSound(const std::string& type)
{
    if(type == "pistol")
    {
        sf::Sound sound;
        int random = std::rand() % 3;
        if(random == 0)
            sound = sf::Sound(bufferPistolOne_);
        else if(random == 1)
            sound = sf::Sound(bufferPistolTwo_);
        else
            sound = sf::Sound(bufferPistolThree_);
       
        vSounds_.push_back(sound);
        vSounds_.at(vSounds_.size() - 1).play();
    }
    else if(type == "rifle")
    {
        sf::Sound sound;
        int random = std::rand() % 4;
        if(random == 0)
            sound = sf::Sound(bufferRifleOne_);
        else if(random == 1)
            sound = sf::Sound(bufferRifleTwo_);
        else if(random == 2)
            sound = sf::Sound(bufferRifleThree_);
        else
            sound = sf::Sound(bufferRifleFour_);
       
        vSounds_.push_back(sound);
        vSounds_.at(vSounds_.size() - 1).play();
    }
    else if(type == "grass")
    {

        sf::Sound sound;
        int random = std::rand() % 7;
        if(random == 0)
            sound = sf::Sound(bufferGrassOne_);
        else if(random == 1)
            sound = sf::Sound(bufferGrassTwo_);
        else if(random == 2)
            sound = sf::Sound(bufferGrassThree_);
        else if(random == 3)
            sound = sf::Sound(bufferGrassFour_);
        else if(random == 4)
            sound = sf::Sound(bufferGrassFive_);
        else if(random == 5)
            sound = sf::Sound(bufferGrassSix_);
        else
            sound = sf::Sound(bufferGrassSeven_);
   
       
        vSounds_.push_back(sound);
        vSounds_.at(vSounds_.size() - 1).play();
    }
}
 


Thanks! :D

11
Graphics / Re: Help with white texture sprite issue
« on: December 05, 2014, 05:20:30 am »
What should the white squares represent?

Also have you read this:
http://sfml-dev.org/tutorials/2.1/graphics-sprite.php#the-white-square-problem
https://github.com/SFML/SFML/wiki/FAQ#graphics-white-rect

It's a rather bad idea to let your tree object hold the texture and this also most likely the origin of your problem, because once you push_back the tree, you're creating a copy of the tree, thus the texture reference will be lost and you get a white square.
Instead you should manager your resources outside of the class, for example with a resource holder.

Thanks man, it now hold a pointer to a texture inside an ImageManager class. That way when it's copied it still points to the same place. Thanks again!

12
Graphics / Help with white texture sprite issue
« on: December 03, 2014, 04:50:34 am »
Hi, I am trying to draw certain sprites, but they end up being drawn as white squares or even distorted. Everything that has been drawn as a white rectangle follows the following format:

Object
-Texture
-Sprite

Then the level has a list of objects.

It then returns the list by copy to the engine which draws it.

Here is the code for the trees:
http://pastebin.com/UmsapXJj

The end result:


Other items are having the same issue such as the gun. The tiles aren't and they are the only ones stored in a regular array. Could that have something to do with it?

Thanks!

13
Window / Viewport not changing and stays at (0, 0)
« on: August 16, 2014, 07:05:12 am »
Hi, I have the following code:

view.reset(sf::FloatRect(mainLevel->rooms[i]->roomSprite.getPosition().x, mainLevel->rooms[i]->roomSprite.getPosition().y, window.getSize().x, window.getSize().y));
window.setView(view);
std::cout << "Room Position: (" << mainLevel->rooms[i]->roomSprite.getPosition().x << ", " << mainLevel->rooms[i]->roomSprite.getPosition().y << ")" << std::endl;
std::cout << "Viewport: (" << window.getView().getViewport().left << ", " << view.getViewport().top << ")" << std::endl;
 

However, when I have the viewport position log, it is at (0, 0) when the room position is at (-75, -75). This happens even if I hardcode the (-75, -75) into it. Does anyone know why this happens? Thanks!

14
General / Re: Does anyone else have massive frame drops for no reason?
« on: August 10, 2014, 11:40:08 pm »
motion blur
Could you PM me about how to add motion blur?
I didn't add motion blur? I said that I made it so that my monitor has minimal motion blur/ghosting.

15
General / Re: Does anyone else have massive frame drops for no reason?
« on: August 10, 2014, 09:43:50 pm »
2000+ FPS?
You should limit the frame rate to 60 to see if that helps:
sf::RenderWindow::setFramerateLimit(int limit)

It seems to help but at the same time it seems to not help. I have it vsync at both 120Hz and 144Hz (120Hz is when I use lightboost to remove motion blur completely to make sure that I wasn't just ghosting).

Pages: [1] 2