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

Pages: [1]
1
Graphics / OpenGL draw ignoring sf::View
« on: January 05, 2012, 11:57:41 pm »
So I need to constrain my GUI to an sf::View (the default one) and the library I use uses some opengl trickery to draw textures (it was made for OpenGL but has a SFML renderer)
The only problem is that these textures ignore my sf::View, which I need.

Is there any way to get the texture to obey me?
The code for rendering: (tex is a sf::Texture)
tex->Bind();
 
                        glColor4f(1, 1, 1, 1 );
 
                        glBegin( GL_QUADS );
                                glTexCoord2f( u1, v1 );         glVertex2f(rect.x,     rect.y);
                                glTexCoord2f( u1, v2 );         glVertex2f(rect.x,     rect.y + rect.h);
                                glTexCoord2f( u2, v2 );         glVertex2f(rect.x + rect.w, rect.y + rect.h);
                                glTexCoord2f( u2, v1 );         glVertex2f(rect.x + rect.w, rect.y) ;
                        glEnd();
 
                        glBindTexture( GL_TEXTURE_2D, 0);

2
General / Problems with XCode
« on: December 27, 2010, 12:26:29 am »
So I followed the Xcode tutorial and pasted the SFML include folder into my project folder, and I can #include "SFML/Graphics.hpp", but it says that sf is not a namespace. Any idea on why this is happening?

3
General / Input problem
« on: October 03, 2010, 04:57:34 pm »
So I'm porting my engine from SDL to SFML and I'm having some trouble porting my input system.
Input.h
Code: [Select]

#ifndef BULLWHIP_INPUT_H
#define BULLWHIP_INPUT_H
#include <SFML/Graphics.hpp>

class bc_Input
{
    public:
        bc_Input();
        bool bm_KeyHit(sf::Key::Code key);
        bool bm_KeyDown(sf::Key::Code key);
        int bm_MouseX();
        int bm_MouseY();
        void bm_init(sf::RenderWindow& app);
    private:
        sf::RenderWindow& App;
        sf::Input& bv_input;
};

#endif


Input.cpp
Code: [Select]


#include "Input.h"

bool bc_Input::bm_KeyDown(sf::Key::Code key)
{
    return bv_input.IsKeyDown(key)
}

bool bc_Input::bm_KeyHit(sf::Key::Code key)
{
    sf::Event event;
    while(App.GetEvent(event) && event.Type == sf::Event::KeyPressed)
    {
        switch(event.Key.Code)
        {
            case key: return true; break;
            default:
                break;
        }
    }

}

void bc_Input::bm_init(sf::RenderWindow& app)
{
    App = app;
    bv_input = App.GetInput();
}

int bc_Input::bm_MouseX()
{
    return bv_input.GetMouseX();
}

int bc_Input::bm_MouseY()
{
    return bv_input.GetMouseY();
}

bc_Input::bc_Input()
{
    bv_input = App.GetInput();
}


I get these errors:


c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/SFML/System/NonCopyable.hpp: In copy constructor 'sf::Window::Window(const sf::Window&)':
c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/SFML/System/NonCopyable.hpp:57: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private
c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/SFML/Window/Window.hpp:56: error: within this context


c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/SFML/System/NonCopyable.hpp: In copy constructor 'sf::Input::Input(const sf::Input&)':
c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/SFML/System/NonCopyable.hpp:57: error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private
c:\program files (x86)\codeblocks\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/SFML/Window/Input.hpp:45: error: within this context

I've got no idea why this is happening.

Pages: [1]
anything