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

Pages: [1]
1
General / GLcoordinates
« on: May 04, 2011, 08:05:23 am »
First off I know this question has been asked a billion times, but I'm not having a problem converting them. I'm having an issue with how I'm converting them.

This is some of my code, including how I convert the coordinates and my gluperspective
Code: [Select]

//VIDEO_WIDTH=800 VIDEO_HEIGHT=600
mGame.Click.x=(int)(((mouse.x*3.0)-(VIDEO_WIDTH/2))/3.0);
mGame.Click.y=(int)-(((mouse.y*3.0)-(VIDEO_HEIGHT/2))/3.0);

gluPerspective(90.0f, 1.3f, 1.0f, 0.0f);


I've figured out that the way I convert the coordinates basically assigns 3 SFML coordinates to 1 GL coordinate(at least I think) and this has a very undesirable effect on my Picking and pathfinding systems :/

This is an screenshot showing this issue:
http://img4.imageshack.us/img4/8531/examplebm.png
(the pointer is unmoved)
NOTE: I'll have smaller objects so an offset is a big issue

I don't think there's anything that will give me a perfect solution to this, and that's not what I'm asking for... but is there anything I could do to get the closest OpenGL coordinate?

NOTE: if you want to see more of my code just ask... I was just trying to prevent posting 800 or so lines.

EDIT:

I found a solution that works for me. Thanks anyway.

2
Window / Input problem?
« on: May 02, 2011, 08:58:43 am »
Ok, thanks... I got what I wanted to work :)

3
Window / Input problem?
« on: May 02, 2011, 08:21:13 am »
I'm having sort of a problem with how I'm handling my mouse click events. I'm using input and I have it so that when I click the window it will call a function, but it will call said function several time when I just clicked once.

With this code here:
Code: [Select]
#include <SFML/Window.hpp>
#include <iostream>

void Hello() {
std::cout << "hello" << "\n";
}

int main()
{
    sf::Window App(sf::VideoMode(800, 600, 32), "Input?");

    const sf::Input& Input = App.GetInput();

    while (App.IsOpened())
    {
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                App.Close();

            if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
                App.Close();
        }
        bool LeftButtonDown = Input.IsMouseButtonDown(sf::Mouse::Left);
        if(LeftButtonDown) Hello();

        App.Display();
    }

    return EXIT_SUCCESS;
}

I get:
Quote
hello
hello
hello
hello
hello
hello
hello
hello
hello
[...]*

*you get the point.

Is it that I'm handing my mouse clicks wrong or what?

4
General / Window Movement
« on: November 24, 2010, 09:07:38 am »
Well, if it's not worth the effort to get the windows movement, then it wouldn't be important because I'd do something else, but for this game I'd like to make movement of an object within the game be determined by the movement of the window.

5
General / Window Movement
« on: November 23, 2010, 10:41:08 pm »
Ah, sorry about the typo. It would be Qt, but anyways. Is there any way that I could do this? The game would be directed towards GNU/Linux OS's, so I'm looking for any solution that doesn't have Win32 or anything. Would it even be possible with X-Window?

6
General / Window Movement
« on: November 23, 2010, 09:26:27 am »
I'm thinking about making a game that would involve the player to move the window.

Is it possible with SFML to detect how much the window was moved by or in what direction the Window moved? If so how would I do this? If it isn't possible with SFML, what if I embedded it into QT or wxWidgets?

Pages: [1]
anything