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

Pages: [1]
1
General / World to Window Coordinate Conversion?
« on: June 09, 2011, 11:11:11 pm »
I'm using box2d with sfml and I'm creating objects by clicking and dragging the mouse. When dragging I don't want the cursor to go past the corner of the ghost object when it hits another object (checked using box2d). Otherwise the cursor keeps going past the corner of the ghost and I think that looks strange. It's not really that important though.

2
General / World to Window Coordinate Conversion?
« on: June 09, 2011, 10:29:39 pm »
Is there a function to convert a world coordinate to a window coordinate? I want to be able to use RenderWindow.SetCursorPosition() to set the cursor to a world coordinate. If there is not a function, does anyone have a preferred method of doing this?

3
Graphics / Creating RenderImage
« on: June 05, 2011, 09:17:48 pm »
Oh, thanks for having a look at my problem anyway.

4
Graphics / Creating RenderImage
« on: June 05, 2011, 09:03:31 pm »
Guess so, GMA 950 in my netbook.

5
Graphics / Creating RenderImage
« on: June 05, 2011, 07:39:32 pm »
This is what I'm seeing.



If there's anything else you need, let me know.

6
Graphics / Creating RenderImage
« on: June 04, 2011, 10:32:34 pm »
Quote from: "Groogy"
MyRenderImage only exists in the scope of the member function. You have to declare it as a member variable if you want to keep it.

This is basic C++ or any other programming language, my suggestion is that you study that trough a book or tutorial. Before or along side SFML doesn't matter.
That's not the issue. The code is a minimum example to show the issue I am having. Please run the code and watch what happens when Create is called.

7
Graphics / Creating RenderImage
« on: June 04, 2011, 09:34:02 pm »
Okay here's a minimum example of the trouble I am having.

Code: [Select]
#include <SFML/Graphics.hpp>
#include "include/MyObject.h"

int main()
{
    sf::RenderWindow MyRenderWindow(sf::VideoMode(640, 320, 32), "Title");

    MyObject MyObjectInstance;
    MyObjectInstance.CreateRenderImage();

while (MyRenderWindow.IsOpened())
{
   sf::Event Event;
        while (MyRenderWindow.PollEvent(Event))
        {
            if (Event.Type == sf::Event::Closed)
                MyRenderWindow.Close();
        }
        MyRenderWindow.Clear();
        MyRenderWindow.Display();
}
return EXIT_SUCCESS;
}



MyObject.cpp
Code: [Select]
#include "MyObject.h"

MyObject::MyObject()
{
}

MyObject::~MyObject()
{
}

void MyObject::CreateRenderImage(void)
{
    sf::RenderImage MyRenderImage;
    MyRenderImage.Create(30, 30);  // MyRenderWindow stops drawing. Code after this would execute though.

}

8
Graphics / Creating RenderImage
« on: June 04, 2011, 07:20:26 pm »
I am able to call Create on a RenderImage in the main() function of a program. If I call it in a member function of a class, my main window, a RenderWindow draws nothing. The program seems to continue running.  What am I missing here?

Pages: [1]
anything