Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Integration with wxWidgets?  (Read 1266 times)

0 Members and 1 Guest are viewing this topic.

Anthony11

  • Newbie
  • *
  • Posts: 38
    • View Profile
Integration with wxWidgets?
« on: July 03, 2015, 03:52:32 pm »
I can't find this anywhere, so can someone guide me towards the solution. I want to create a SFML canvas on frame in wxWidgets (wxSmith).

(wxSFML.cpp)  http://pastebin.com/TqsGmVhT
(wxSFML.h)      http://pastebin.com/J80PeFvF

wxSmith Creation Code:
$(THIS) = new $(CLASS)($(PARENT),$(ID),$(POS),$(SIZE),$(STYLE));

(Build Error):
C:/Users/Anthony/Desktop/TestProject/wxSFML.cpp:9: undefined reference to `vtable for wxSFML'
C:/Users/Anthony/Desktop/TestProject/wxSFML.cpp:9: undefined reference to `vtable for wxSFML'
C:/Users/Anthony/Desktop/TestProject/wxSFML.cpp:9: undefined reference to `vtable for wxSFML'

« Last Edit: July 03, 2015, 03:56:03 pm by Anthony11 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10822
    • View Profile
    • development blog
    • Email
Re: Integration with wxWidgets?
« Reply #1 on: July 03, 2015, 03:59:49 pm »
Google could have answered that in less time than it took you to create this thread. ;)

Quote from: GCC FAQ (via StackOverflow)
The solution is to ensure that all virtual methods that are not pure are defined. Note that a destructor must be defined even if it is declared pure-virtual [class.dtor]/7.

Meaning you haven't defined all virtual functions that are needed.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Anthony11

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Integration with wxWidgets?
« Reply #2 on: July 03, 2015, 04:11:56 pm »
But the problem still remains with the wxevents

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10822
    • View Profile
    • development blog
    • Email
Re: Integration with wxWidgets?
« Reply #3 on: July 03, 2015, 04:28:23 pm »
What issue? Please take a look at this thread.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Anthony11

  • Newbie
  • *
  • Posts: 38
    • View Profile
Re: Integration with wxWidgets?
« Reply #4 on: July 04, 2015, 03:20:01 pm »
Sorry for responding late, anyway I fixed it! Turns out that there was an error in defining event handlers. Anyway I have a different problem now. As I understood SFML, the 0, 0 position is of renderwindow is always a center. In the case of integration in wxWidgets this is apparently not the case. I drew a sprite just to see where it draws on screen, and no matter the size it drew in the bottom left corner. Tried to move the coordinates by 10 in each direction but (-10, -10; 10, -10; -10, 10; 10, 10) and the object was invisible in all four cases. So apparently I can't find a solution to this, I deducted that the positions might be relative so I was about to try something like 0.5, but I accidentally deleted the project a while before  :'(

So is there any way that I can change the position of 0, 0 to the center of component of RenderWindow, regardless of the Form's size.

Hapax

  • Hero Member
  • *****
  • Posts: 3351
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Integration with wxWidgets?
« Reply #5 on: July 05, 2015, 08:30:52 pm »
the 0, 0 position is of renderwindow is always a center.
This is not true.
The centre of the window is the coordinate given to the view as the centre (view.setCenter). In the default view, (0, 0) is the top-left of the window.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*