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

Pages: [1] 2
1
Window / Re: qt5 widgetHandle -> SFML2.0
« on: September 27, 2016, 12:41:46 pm »
Wasting your time?.. someone else might actually hold an answer to the problem instead of boosting their ego by posting how it in fact is possible to cast a long to a bool or whatnot. Well now your postcount went ++.

2
Window / Re: qt5 widgetHandle -> SFML2.0
« on: September 27, 2016, 12:24:20 pm »
Wow, that is why I asked the question here... to hopefully save the time and effort.
But you sir, seem to have time on your hand to go overboard to explain casting ;) \o/ yaay!

3
Window / Re: qt5 widgetHandle -> SFML2.0
« on: September 27, 2016, 11:55:50 am »
exactly, my guess is that WinId from QtWidget is not a handle but something else completely.
Seems that I am not the only one with this problem.
But what bothers me is that it works with some configurations.

4
Window / Re: qt5 widgetHandle -> SFML2.0
« on: September 27, 2016, 10:59:07 am »
There IS magic involved ;)
This is weird, I looked into SFML headers and this is how a WindowHandle is defined on my setup:

#elif defined(SFML_SYSTEM_LINUX) || defined(SFML_SYSTEM_FREEBSD)

    // Window handle is Window (unsigned long) on Unix - X11
    typedef unsigned long WindowHandle;


and a WinId() returns a WId which is defined as a long long unsigned int.
static_cast fails aswell as reinterpret_cast.

I am running C++11 enabled on a gcc 6.2.1. on a 64bit system.


5
Window / Re: qt5 widgetHandle -> SFML2.0
« on: September 26, 2016, 09:53:34 pm »
Belive me, I have tried this but there seems to be something changed. I have had Qt wrap up SFML nicely before.
Please try your lib, which seems to do a just that with Qt 5.7 and SFML 2.4 on a linux system and if that works then I'll be the first to confess that your lib has some vodoo-magic involved ;)

6
Window / qt5 widgetHandle -> SFML2.0
« on: September 26, 2016, 12:51:09 pm »
Hi I am trying to setup a QTSFMLCanvas as seen in eg: http://becomingindiedev.blogspot.se/2013/10/qt-5-and-sfml-20-integration.html

Qt5-widget has a winId() method that is supposed to return the native handler for the widget. On my platform (linux Arch 64bit) it is a long long unsigned int and RenderWindow seems to want a long unsigned int.

hence,
RenderWindow::create(reinterpret_cast<sf::WindowHandle>(winId()));

fails with: invalid cast from type 'WId {aka long long unsigned int}' to type 'sf::WindowHandle {aka long unsigned int}'

Is there a workaround or a way to convert the handle? I have been giving google hard time with this one and have found nothing.

static_cast just hangs the application.

Any ideas?


7
Graphics / Re: rotate around different origins
« on: December 26, 2013, 12:41:45 am »
After some experimenting I figured out that I had to skip the common states.transform *= getTransform(); in draw method and build my own transform.  :D works like a charm now.

 


8
Graphics / rotate around different origins
« on: December 25, 2013, 10:37:24 pm »
Hi,
I have a sf::Drawable that has a sprite that draws a sf::Sprite at 0,0 and it has a specified orgin set. eg. center of the sprite.

From time to time I'd like to rotate the sprite around another origin. Is there a way to do this withouth having to transform the object back and forth. As soon as I change the origin of the sprite it moves since the 0,0 will now have the new position.

9
System / Re: no KeyEvents in wxWidget
« on: February 12, 2013, 11:58:24 pm »
Tried wxPanel::SetFocus and wxPanel::SetFocusIgnoringChildren without any luck. So I had to go with the EventPipe of wxWidget for theese specific events.

Thanks for the quick answers  :D

10
System / no KeyEvents in wxWidget
« on: February 12, 2013, 10:24:01 pm »
Hi,
is it known that no KeyEvents are triggered when using SFML with wxWidget?
I am polling the event in a mainloop like this:

   sf::Event event;
   while (window.pollEvent(event))
   {
      if (event.type == sf::Event::KeyPressed) {
         LOG << "Yeah!\n";
      }
   }
 

however the polling the Keyboard directly is still possible.
Is there a workaround to get the KeyEvent working?

11
Graphics / Re: Sprite composition and transformation
« on: January 08, 2013, 08:24:20 pm »
Which is what you suggested eXpl0it3r :D
Thanks!


12
Graphics / Re: Sprite composition and transformation
« on: January 08, 2013, 08:23:12 pm »
I don't know if my description of the problem was insufficient. I figured out how to solve it...

in the drawMethod I did as suggested in documentation for transformable:

virtual void draw(sf::RenderTarget& target, sf::RenderStates states) const
{
   states.transform *= getTransform();
   target.draw(..., states);
}

 

This would add the transformations for the sprite onto the composed sprites drawn in draw!

:D

13
Graphics / Sprite composition and transformation
« on: January 08, 2013, 08:07:18 pm »
Is this possible...

Let's say I have a class that extends sf::Sprite and implements void draw(sf::RenderTarget& target, sf::RenderStates states).
And in draw(..) I render a couple of sprites that move and what not.

is it possible to do a setPosition of the class and have the rendered content translate accordingly?

What is the correct way of doing this?

14
Graphics / Re: Drawing vertexarrays always start from 0,0
« on: January 05, 2013, 10:21:59 am »
Obviously! what was I thinking?  :o

15
Graphics / Re: Drawing vertexarrays always start from 0,0
« on: January 05, 2013, 03:23:20 am »
I guess the size is for initial allocation of the container. Why put an initial value into it? Will appends upon appends not have to reallocate at some point otherwise?
Still, the documenation does not mention the initial (0,0) vertex there.



 

Pages: [1] 2