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

Pages: [1]
1
General / SFML 2 OpenGL version
« on: July 05, 2011, 11:03:30 pm »
Yeah, so when OS X Lion comes out, it'll work when I select 3.2 without any changes?

2
General / SFML 2 OpenGL version
« on: July 05, 2011, 10:32:58 pm »
SFML 2, latest from the repository.

3
General / SFML 2 OpenGL version
« on: July 05, 2011, 10:06:33 pm »
Hello,

So I'm trying to change the OpenGL version on my SFML Project. I took out the important code to show you what I am currently doing below.

Code: [Select]
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <SFML/OpenGL.hpp>
#include <iostream>

int main(int argc, char *argv[])
{
sf::Window Win;

sf::ContextSettings cs;

cs.MajorVersion = 2;
cs.MinorVersion = 0;
cs.DepthBits = 32;
cs.StencilBits = 0;
cs.AntialiasingLevel = 0;

Win.Create(sf::VideoMode(1024, 768, 32), "Sortmania", sf::Style::Default, cs);

std::cout<< Win.GetSettings().MajorVersion << "." << Win.GetSettings().MinorVersion;

return 0;
}


However, when I run that code, no matter what I put in for the MajorVersion and MinorVersion, it returns the same version, 2.1. I want to get this working so that I can change it to OpenGL 3.2 when OS X Lion comes out (I understand that it does have 3.2, and the release date is soon). I've tried setting it to a few versions, but I'm not sure it's working. Is this supposed to happen, and will work with 3.2, or am I missing something?

EDIT:
Also, it's quite interesting that I can set the antialiasing level to something impossibly high (1024) and it returns the same antialiasing level.

4
General / FindSFML.cmake question
« on: July 05, 2011, 10:03:08 pm »
Oh cool. I can fix my CMake hacks now.

5
Feature requests / Make SFML Window not depend on SFML System
« on: July 05, 2011, 06:54:50 pm »
I guess I just didn't see the necessity. On the features page, all it shows is threading and timing.

6
Feature requests / Make SFML Window not depend on SFML System
« on: July 05, 2011, 05:12:58 pm »
Move the stuff from SFML System that SFML Window requires into SFML Window? I think the only thing you might actually need is timing, I'm not sure that you'd need threading.

7
Feature requests / Make SFML Window not depend on SFML System
« on: July 05, 2011, 04:57:46 pm »
Most of the stuff in the SFML System library I can get with something like Boost (Boost::Thread, etc). I don't really need anything in the SFML System library and would prefer to only link the SFML Window library, however the SFML Window library depends on the SFML System library. I think that SFML System stuff should be independent of Window, so I can use the SFML Window library independently.

8
Window / Window GetPosition or desktop mouse position?
« on: April 13, 2011, 09:01:00 pm »
That's a great way to do it for now. I've built a quick demo, and you can view this code below.

Code: [Select]
#include <SFML/Graphics.hpp>
#include <Windows.h>
 
int main()
{
sf::RenderWindow window(sf::VideoMode(1024, 768), "SFML window", sf::Style::None);

int sx = 0;
int sy = 0;
bool mouseDown = false;
    while (window.IsOpened())
    {
        sf::Event event;
        while (window.PollEvent(event))
        {
            if (event.Type == sf::Event::Closed)
{
                window.Close();
}

if (event.Type == sf::Event::MouseButtonPressed)
{
if (event.MouseButton.Button == sf::Mouse::Left)
{
sx = event.MouseButton.X;
sy = event.MouseButton.Y;

mouseDown = true;
}
}

if (event.Type == sf::Event::MouseButtonReleased)
{
if (event.MouseButton.Button == sf::Mouse::Left)
{
mouseDown = false;
}
}

if (event.Type == sf::Event::MouseMoved)
{
if (mouseDown)
{
POINT p;
GetCursorPos(&p);
window.SetPosition(p.x-sx,
p.y-sy);
}
}
        }

        window.Clear();

        window.Display();
    }
 
    return EXIT_SUCCESS;
}


However, this does require the use of a platform specific function. I do plan to port my project to Mac OS X and possibly Linux in the future, so this can only be a temporary solution. Is there any plan to add some similar function to GetCursorPos in SFML in the future (either in the event handling, Input class, or both)? If not, is there a way I can suggest it to Laurent, or perhaps contribute such code myself?

9
Window / Window GetPosition or desktop mouse position?
« on: April 13, 2011, 05:49:30 am »
Hello,

For my current project, I am attempting to create a custom titlebar, along the lines of Starcraft 2, the League of Legends launcher and the World of Warcraft launcher. I've set my RenderWindow's style to None, and I can render the top bar with other SFML code. However, I want the user to be able to drag the window around the desktop using the titlebar. I can check if the user is pressing the title bar, and see when the mouse moves, but I can't find a way to figure out where to move the window. I need to move the window based on the movement of the mouse. My first thought was to find the position of the window and add the position of the mouse on the window, but I failed to find a GetPosition function on the window. My second option was to see if I could get the cursor's desktop position, and set the window to that minus the mouse's position on the window, but I also failed to find this. Does anyone know where I can get one of these two functions or another way to accomplish my goal?

Pages: [1]
anything