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.


Topics - ezio160324

Pages: [1]
1
Graphics / So, can't use sf::Texture as a const
« on: August 15, 2014, 02:11:13 pm »
So, I'm using this 3D fork of SFML by binary1248. I've run into a problem. His *.objs require
const sf::texture
as the texture. Only problem, it my program crashes if I try to create an
sf::texture
as const. Any ideas?

2
Window / First Person 3D Camera?
« on: July 15, 2014, 11:08:56 am »
Hey. I'm wondering if anyone has made anything to help with a 3D first person camera. I saw sf3d but it's not for SFML 2.  :( Anyway, if nobody has done such a thing, can you give me some pointers on where to start?

3
Window / Certain events only working with framelimit on or off
« on: July 13, 2014, 12:53:07 am »
I am working with a simple window that plays some music and shows a red circle. In my code, the code I have to lock the cursor to the center only works with framelimit off. Also, my code for pressing 'esc' to close the window only works with it on. It's confliction. Here's my code:

#include <SFML\System.hpp>
#include <SFML\Config.hpp>
#include <SFML\OpenGL.hpp>
#include <SFML\Window.hpp>
#include <SFML\Graphics.hpp>
#include <SFML\Audio.hpp>
#include <btBulletCollisionCommon.h>
#include <btBulletDynamicsCommon.h>


sf::Event event;
sf::Event event2;
sf::Event event3;


int main() {


        sf::Music music;
        if (!music.openFromFile("meh.flac"))
                return -1; // error
        music.setLoop(true);

        sf::RenderWindow window(sf::VideoMode(800, 600), "OpenGL");
        sf::CircleShape shape(50.f);
        shape.setPosition(100, 0);
        shape.setFillColor(sf::Color::Red);

        sf::Mouse::setPosition(sf::Vector2i(400, 300), window);

        music.play();

        while (window.isOpen())
        {                      
                //input handler loop
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)) {
                        window.close();
                }


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

                while (window.pollEvent(event2)) {
                        if (event2.type != sf::Event::MouseLeft) {
                                sf::Mouse::setPosition(sf::Vector2i(400, 300), window);
                        }
                }

                        window.clear();
                        window.draw(shape);
                        window.display();

                }
       

                return 0;
        }

I'm very sensitive about my code, too, so please don't make fun of me for it.  :)

Pages: [1]