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

Pages: [1] 2 3 ... 5
1
Window / Re: OpenGL Access Violation
« on: May 18, 2013, 02:21:17 pm »
woops....thanks!

2
Window / OpenGL Access Violation
« on: May 18, 2013, 11:20:38 am »
I'm not entirely sure this is an SFML problem, but I think it is. Pretty much, it crashes the moment I try to generate a buffer giving the error:

First-chance exception at 0x00000000 in OpenGLThing.exe: 0xC0000005: Access violation at location 0x0000000000000000.
Unhandled exception at 0x00000000 in OpenGLThing.exe: 0xC0000005: Access violation at location 0x0000000000000000.

Anyway, here is a simple program that gives gives the error.

#define GL_GLEXT_PROTOTYPES

#include <GL/glew.h>
#include <SFML/Window.hpp>
#include <SFML/OpenGL.hpp>

int main()
{
        sf::ContextSettings contextSettings;
    contextSettings.depthBits = 32;
    contextSettings.stencilBits = 8;
    contextSettings.antialiasingLevel = 4;
    contextSettings.majorVersion = 3;
    contextSettings.minorVersion = 3;
       
        sf::Window window(sf::VideoMode(800, 600, 32), "OpenGL Triangle", sf::Style::Default, contextSettings);

        GLuint positionBuffer;
        glGenBuffers(1, &positionBuffer);

        window.close();
        return 0;
}

3
Window / Re: OS X OpenGL Failure
« on: March 12, 2013, 08:12:41 am »
That worked, Thanks.

4
Window / OS X OpenGL Failure
« on: March 11, 2013, 01:17:31 pm »
SFML Works when I don't use OpenGL but when I do I get this error:

Undefined symbols for architecture x86_64:
  "_glClear", referenced from:
      _main in main.o
  "_glViewport", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using the default template with XCode 4.6 (although I've switched off C++11 because that made it break) and I used the example code from the "A typical OpenGL-with-SFML program" here: http://sfml-dev.org/tutorials/2.0/window-opengl.php

Thanks for any help

5
Graphics / Re: SFML 2 Vertex Miscalibration?
« on: November 24, 2012, 08:59:02 am »
Oh, I thought they were pixel co ordinates. Thanks.

6
Graphics / SFML 2 Vertex Miscalibration?
« on: November 24, 2012, 08:36:24 am »
The x values with sf::Vertex seem to be one off what they are meant to be.

This shows nothing:

#include <SFML/Graphics.hpp>

int main()
{
        //The Window
        sf::RenderWindow window(sf::VideoMode(600, 400), "SFML works!");
        sf::Vertex line[2];

        while (window.isOpen())
        {
                line[0].position.x = 0;
                line[0].position.y = 0;

                line[1].position.x = 0;
                line[1].position.y = 100;

                window.clear();
                window.draw(line, 2, sf::Lines);
                window.display();
        }

        return 0;
}

while this shows a line going across the top of the window

#include <SFML/Graphics.hpp>

int main()
{
        //The Window
        sf::RenderWindow window(sf::VideoMode(600, 400), "SFML works!");
        sf::Vertex line[2];

        while (window.isOpen())
        {
                line[0].position.x = 0;
                line[0].position.y = 0;

                line[1].position.x = 100;
                line[1].position.y = 0;

                window.clear();
                window.draw(line, 2, sf::Lines);
                window.display();
        }

        return 0;
}

7
Graphics / Re: sf::Sprite.getGlobalBounds().width or height
« on: October 11, 2012, 02:26:25 am »
Thanks

8
Graphics / sf::Sprite.getGlobalBounds().width or height
« on: October 10, 2012, 01:11:48 pm »
I've worked out that sf::Sprite.getGlobalBounds().left and top get the left most and the top most parts of the sprite after transformations, though what does width and height do? Does it get the distance from the left most corner to the right most corner / the top most corner to the bottom most corner or something else? Thanks.

9
Graphics / Re: Origin Scaling
« on: October 07, 2012, 04:52:42 pm »
I just didn't expect it to affect the origin. Anyway, I fixed it now by dividing origin by the scale when getting the origin and multiplying it by the scale when setting it.

10
Graphics / Origin Scaling
« on: October 07, 2012, 04:23:29 pm »
I'm unsure as to whether this was intentional or not, but when scaling anything in SFML 2, it also scales the origin. This for example -
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(800, 600), "Origin Scaling");
    sf::RectangleShape rectangle;
    rectangle.setSize(sf::Vector2f(100, 50));
    rectangle.setScale(0.25, 0.25);
    rectangle.setOrigin(-300, -300);

    while (1)
    {
        window.draw(rectangle);
        window.display();
    }
}
 
will not move the rectangle 300 pixels away from the left and 300 from the top, but rather a quarter of that.

11
SFML website / Missing 'sf::' in Documentation
« on: October 04, 2012, 08:46:25 am »
In the example in http://www.sfml-dev.org/documentation/2.0/classsf_1_1Drawable.php I think
virtual void draw(sf::RenderTarget& target, RenderStates states) const
should be
virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
That's all  ;)

12
Graphics / Re: Set Size of Texture
« on: October 04, 2012, 06:56:32 am »
Alright, thanks :)

13
Graphics / Re: Set Size of Texture
« on: October 03, 2012, 02:37:48 pm »
Well, I'm not entirely sure. Whatever will simply scale up or down the size of the sprite that is drawn on the screen.

14
Graphics / Set Size of Texture
« on: October 03, 2012, 12:31:35 pm »
Hi,

Is there any way of creating or resizing a texture to a certain size. I know there is the scale function though that multiplies the size by the given amount instead of setting it to something.

Thanks

15
General / Re: SFML-2.0 Immediate Crash
« on: June 25, 2012, 03:46:21 pm »
I'll give it a go.

Thanks

Pages: [1] 2 3 ... 5