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

Pages: [1] 2 3
1
Window / [MAC OS X - SFML2] GetMouseX() after SetCursorPosition(x,y)
« on: December 09, 2010, 02:39:44 pm »
Any news on this fix? I really need it :D

2
Window / Disabling the CMD window that opens when creating a window
« on: December 06, 2010, 10:51:12 pm »
From my memory it should be something like this:

Code: [Select]

int WINAPI CALLBACK WinMain(
  HINSTANCE hInstance,
  HINSTANCE hPrevInstance,
  LPSTR lpCmdLine,
  int nCmdShow
)
{
    // do sfml stuff


   return 0;
}

3
Window / Disabling the CMD window that opens when creating a window
« on: December 06, 2010, 08:48:37 pm »
Maybe you should create a Win32 Project not a Console Win32 Project.

4
Window / Help visual studio 2010 and C
« on: December 06, 2010, 03:35:11 pm »
You have to copy the dll's in an appropriate directory, so that you're exe can dynamically link to them. Normally you would put the dll's next to the executable.

5
Window / Help visual studio 2010 and C
« on: December 06, 2010, 02:56:17 pm »
Then, please do post the link errors.

6
Window / Help visual studio 2010 and C
« on: December 06, 2010, 02:39:42 pm »
You have to link against the SFML libraries. Be extra careful to link with the debug ones if you're working in debug or with the release ones if you work in release mode. In you're case, you are working with the debug mode.

7
Window / [MAC OS X - SFML2] GetMouseX() after SetCursorPosition(x,y)
« on: December 06, 2010, 02:16:58 pm »
Okay, looking forward to hearing from Hiura then! Thanks for your help!

8
Window / [MAC OS X - SFML2] GetMouseX() after SetCursorPosition(x,y)
« on: December 06, 2010, 01:42:10 pm »
Sorry for the indentation, it's fixed now. The code outputs the last position  the mouse was at, before calling window.SetCursorPosition.

9
Window / [MAC OS X - SFML2] GetMouseX() after SetCursorPosition(x,y)
« on: December 06, 2010, 01:05:00 pm »
Is there a way to force an iteration? Or is there a way to get the cursor coordinates updated so i don't wait for another iteration?

Also, an iteration should happen really fast so i think i might get away with not needing an instant update, but this code won't constantly print 400 300 after pressing 's'. Am i doing something wrong here?



Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <map>
#include <math.h>



////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{    
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Shader");
   
    // Create a clock to measure the total time elapsed
    sf::Clock clock;
   
    // Start the game loop
    while (window.IsOpened())
    {
        // Process events
        sf::Event event;
        while (window.GetEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
                window.Close();

            if (event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (event.Key.Code == sf::Key::Escape)
                    window.Close();

                if (event.Key.Code == sf::Key::S)
                {
                    window.SetCursorPosition(400, 300);
                    printf("%d %d\n", window.GetInput().GetMouseX(), window.GetInput().GetMouseY());
                }
            }

            if (event.Type == sf::Event::MouseMoved)
            {
                printf("%d %d\n", event.MouseMove.X, event.MouseMove.Y);
            }
        }

    printf("%d %d\n", window.GetInput().GetMouseX(), window.GetInput().GetMouseY());

        // Finally, display the rendered frame on screen
        window.Display();
    }
   
    return EXIT_SUCCESS;
}

10
Window / [MAC OS X - SFML2] GetMouseX() after SetCursorPosition(x,y)
« on: December 06, 2010, 12:31:14 pm »
This example won't output 400,300 after pressing 's'. Why is that? What is the correct way of doing it?

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <map>
#include <math.h>



////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{    
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Shader");
   
    // Create a clock to measure the total time elapsed
    sf::Clock clock;
   
    // Start the game loop
    while (window.IsOpened())
    {
        // Process events
        sf::Event event;
        while (window.GetEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
                window.Close();

            if (event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (event.Key.Code == sf::Key::Escape)
                    window.Close();

                if (event.Key.Code == sf::Key::S)
                {
                    window.SetCursorPosition(400, 300);
                    printf("%d %d\n", window.GetInput().GetMouseX(), window.GetInput().GetMouseY());
                }
            }

            if (event.Type == sf::Event::MouseMoved)
            {
                printf("%d %d\n", event.MouseMove.X, event.MouseMove.Y);
            }
        }

        // Finally, display the rendered frame on screen
        window.Display();
    }
   
    return EXIT_SUCCESS;
}

11
Window / [MAC OS X-SFML2] No mouse moved events while pressing mouse
« on: December 04, 2010, 11:12:14 am »
It works now as expected! Thanks!

12
Window / [MAC OS X-SFML2] No mouse moved events while pressing mouse
« on: December 03, 2010, 08:15:12 pm »
This little piece of code won't print anything while pressing either mouse buttons and moving the mouse, why is that?

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <map>
#include <math.h>



////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML Shader");

    // Create a clock to measure the total time elapsed
    sf::Clock clock;

    // Start the game loop
    while (window.IsOpened())
    {
        // Process events
        sf::Event event;
        while (window.GetEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
                window.Close();

            if (event.Type == sf::Event::KeyPressed)
            {
                // Escape key : exit
                if (event.Key.Code == sf::Key::Escape)
                    window.Close();
            }

if (event.Type == sf::Event::MouseMoved)
{
printf("%d %d\n", event.MouseMove.X, event.MouseMove.Y);
}
        }

        // Finally, display the rendered frame on screen
        window.Display();
    }

    return EXIT_SUCCESS;
}

13
Graphics / [MAC OS X] SFML2 & Failed to activate the window's conte
« on: December 01, 2010, 12:30:27 am »
Thanks guys! It works now!

14
Graphics / [MAC OS X] SFML2 & Failed to activate the window's conte
« on: November 30, 2010, 10:50:22 pm »
I'm trying to figure out what's happening here. I just get a white window with this code(the output should be black). Also looking at the console i see that every frame a message is sent: "Failed to activate the window's context." I'm on an INTEL card here(old i know), so what could be wrong?

Code: [Select]

////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
#include <SFML/OpenGL.hpp>
#include <iostream>

////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML OpenGL");

    // Start game loop
    while (window.IsOpened())
    {
        // Process events
        sf::Event event;
        while (window.GetEvent(event))
        {
            // Close window : exit
            if (event.Type == sf::Event::Closed)
                window.Close();

            // Escape key : exit
            if ((event.Type == sf::Event::KeyPressed) && (event.Key.Code == sf::Key::Escape))
                window.Close();
        }
        // Clear the depth buffer & color buffer
        glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

        // Finally, display the rendered frame on screen
        window.Display();
    }

    return EXIT_SUCCESS;
}

15
Window / [Mac OS X] Window creation causes "flashes"
« on: November 30, 2010, 05:38:03 pm »
I have successfully implemented streaming video via apple's QTKit. The setup i'm currently working with is this:

Play the video and when exiting create a SFML Window.

The issue i'm experimenting is the following: in the process of the window creation the resolution changes and there  some flashes appear(black and white screens). I was thinking if there is a way to work around these so the transition from the movie to the sfml application would be smooth and no "flashes" would appear.

EDIT: I tested this with bot sfml 1.6 and sfml 1.7.

Pages: [1] 2 3