Closed tienery closed 8 years ago
Integration failures: https://travis-ci.org/ianharrigan/hxWidgets/jobs/116421980
ignore the appveyor one- its travis, ie, linux / osx
I've added an "#undef RegisterClass" not sure if that's the culprit.
Nope, thats windows stuff - and might be needed, although, if it compiles without, its better to not undef the macro of course. The failures are below (if you click "Details")
Error: ./src/hx/widgets/GLCanvas.cpp: In member function ‘Void hx::widgets::GLCanvas_obj::__construct(hx::widgets::Window, hx::Null<int>)’:
./src/hx/widgets/GLCanvas.cpp:43:61: error: call of overloaded ‘wxGLCanvas(cpp::Reference<wxWindow>&, int&)’ is ambiguous
./src/hx/widgets/GLCanvas.cpp:43:61: note: candidates are:
/usr/include/wx-3.0/wx/gtk/glcanvas.h:76:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, const wxGLCanvas*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&) <near match>
/usr/include/wx-3.0/wx/gtk/glcanvas.h:76:5: note: no known conversion for argument 2 from ‘int’ to ‘const wxGLCanvas*’
/usr/include/wx-3.0/wx/gtk/glcanvas.h:64:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, const wxGLContext*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&) <near match>
/usr/include/wx-3.0/wx/gtk/glcanvas.h:64:5: note: no known conversion for argument 2 from ‘int’ to ‘const wxGLContext*’
/usr/include/wx-3.0/wx/gtk/glcanvas.h:53:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&)
/usr/include/wx-3.0/wx/gtk/glcanvas.h:23:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const int*, const wxPoint&, const wxSize&, long int, const wxString&, const wxPalette&)
Error: Build failed
I added undef due to a build failure on Windows, I'm assuming because glcanvas.h in wx uses windows.h in some way. But I'll try and fix the constructor call.
Well, the undef is needed (in some cases) because hxcpp defines its own RegisterClass function which clashes with the windows macro.
Not entirely sure which version of the docs I was using, but just for reference: http://docs.wxwidgets.org/3.0/classwx_g_l_canvas.html
Is 3.0 the version the Linux/Mac builds on Travis using?
Yes travis, actually the entire repository, use wxWidgets 3.0.
Hmm, it's curious. I thought I saw a completely different constructor at some point. Not sure what I was looking at that accepted wxGLAttributes. Regardless, I've added it anyway.
Also, I'm a bit confused about the build error:
./src/hx/widgets/GLCanvas.cpp:43:61: error: call of overloaded ‘wxGLCanvas(cpp::Reference<wxWindow>&, int&)’ is ambiguous
./src/hx/widgets/GLCanvas.cpp:43:61: note: candidates are:
/usr/include/wx-3.0/wx/gtk/glcanvas.h:76:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, const wxGLCanvas*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&) <near match>
/usr/include/wx-3.0/wx/gtk/glcanvas.h:76:5: note: no known conversion for argument 2 from ‘int’ to ‘const wxGLCanvas*’
/usr/include/wx-3.0/wx/gtk/glcanvas.h:64:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, const wxGLContext*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&) <near match>
/usr/include/wx-3.0/wx/gtk/glcanvas.h:64:5: note: no known conversion for argument 2 from ‘int’ to ‘const wxGLContext*’
/usr/include/wx-3.0/wx/gtk/glcanvas.h:53:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&)
/usr/include/wx-3.0/wx/gtk/glcanvas.h:23:5: note: wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const int*, const wxPoint&, const wxSize&, long int, const wxString&, const wxPalette&)
Error: Build failed
It requires a raw pointer to Window, which works for others but not this. How are overloads handled in Haxe? @:overload
? I would have thought the compiler would just know what arguments to use considering everything else after parent
is optional.
I think I had this same problem before when writing my SFML extern, just not sure how I fixed it...
Oh, lol... I'm using version 3.1 of wxWidgets on Windows... Should I test against 3.0?
I dont think that is your issue. I think the issue is the ambiguity to the constructor call.
Yeah all 3.X is compatible since 3.1+ would only contains additions to the api not modifications.
3.1.1 (Dev version): http://docs.wxwidgets.org/trunk/classwx_g_l_canvas.html#af63e54ebdb6a8564444d65b673e540fa
3.0.1 (Stable): http://docs.wxwidgets.org/3.0/classwx_g_l_canvas.html
I think it is... the ambiguity is as a result of using different versions. I'm using the dev build. I need to reinstall wxwidgets with 3.0.
No the ambiguity is because its ambiguous. The compiler doesnt know which constructor you are trying to use.
That's a weird modification for a minor version, but anyway we can't be compatible with the dev version, too many changes all the time.
wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, const int*, const wxPalette&)
wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const int*, const wxPoint&, const wxSize&, long int, const wxString&, const wxPalette&)
And you are calling wxGLCanvas(something, -1)
Well... I've added the wxPoint and wxSize parameters into the constructor.
But I can't test because 3.1 doesn't have a signature matching that XD It's stupid, it really is.
My fault for using the dev version, really.
Right, then yeah you are using the wrong version. as @ibilon said, we should be using the latest stable release.
Well, I shouldn't really say the "dev" version, the Linux/Mac version you're using to test against is 3.0, which has a major change in API when you move over to 3.1, which is insane and makes testing very difficult for these APIs.
Also I'm not against merging the GLAttribute class, after fixing it, but unless it's in the sample travis isn't trying to build it and we can't be sure it works.
3.1 is dev since 3.0.2 is the latest stable.
Actually, im using 3.1 on my machine too. Going to look at the header file
I'm no longer using the GLAttribute class in the test to get it working on 3.0, not 3.1, which is the version of the constructor signature GLAttributes is needed.
There's also a difference in folder names between version 3.0 and 3.1 on Windows... lol... wxwidgets maintainers really do make life difficult, don't they?
Constructors look fine
class WXDLLIMPEXP_GL wxGLCanvas : public wxGLCanvasBase
{
public:
wxEXPLICIT // avoid implicitly converting a wxWindow* to wxGLCanvas
wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
wxEXPLICIT
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const int *attribList = NULL,
const wxPalette& palette = wxNullPalette);
Actually, the create function is what would be needed for Windows, versus the actual constructor.
Erm, so how are you going to call a function on a class without constructing it? The 3rd contstructor looks like the correct candidate.
actually, sorry, i meant the second constructor
Well, the first two functions appear to be constructors, then the next two are member functions of the class, being "Create". The first of which I used to test for Windows using version 3.1 of wxWidgets. But in order for the test to work on Linux and Mac, either travis-ci build config needs to change to make sure it's tested against 3.1 instead of 3.0, or I revert to version 3.0 locally and test against that instead, and tell people to use GLCanvas with care and use it only using version 3.0.
Not sure what the best solution is.
The second constructor requires const int* as the third parameter, which looks a bit out of my comfort zone to try and implement in Haxe.
try something like:
.createInstance(parent != null ? parent._ref : Window.nullWindowRef, untyped __cpp__("((wxWindowID)id)"), Point.defaultPositionRef, Size.defaultSizeRef, style);
Or whatever the other params are, the important bit is the untyped __cpp__("((wxWindowID)id)")
so that it uses the correct constructor
I've tested against 3.0, which works. Do you want me to commit those changes and go from there? (I've changed Build.xml to link to the correct versions of the libs because I'm not sure how to check between versions)
I dont see why you cant use this constructor, which seems to be available on 3.0 and 3.1:
wxGLCanvas(wxWindow *parent,
wxWindowID id = wxID_ANY,
const int *attribList = NULL,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
Well, as far as I am concerned, compiler's don't lie:
It's requiring wxGLAttributes... If I add that it then becomes incompatible with 3.0 to test on Linux/Mac.
It's up to you. Do you want me to send over the latest commits, which I'm sure will work on Linux and Mac on travis this time?
You are right, compilers dont lie.
No constructor could take the source type, or the constructor overload resolution was ambiguous
There are two constructors one takes an const wxGLAttributes& dispAttrs
as a second parameter, the other takes wxWindowID id
as the second.
3.0 and 3.1 have the latter version (wxWindowID
). So you just need to use the right one. untyped __cpp__("((wxWindowID)id)")
as the second param in your createInstance will probably work.
Well, I tried.
Its not an const int *
(IntPtr
) - its a cpp::Reference<int>
But apart from that - you are using the right constructor now it seems.
Actually, i take that back - it is a const int *
why dont you try and do away with all params and try:
WxGLCanvas.createInstance(parent == null ? cast 0 : parent._ref, untyped __cpp__("((wxWindowID)id)"))
Hmm... That does work, actually. I'll commit and see if it builds successfully on Travis.
Hmm... Thought so. Just the same error as before. Ambiguity in the constructor overload.
Time to use wxwidgets 3.1 on travis do you think? :)
I dont, no. Esp. when its not needed and 3.0 and 3.1 have viable constructors. So now you have:
WxGLCanvas.createInstance(parent == null ? cast 0 : parent._ref, untyped __cpp__("((wxWindowID)id)"))
and it didnt work, try:
WxGLCanvas.createInstance(parent == null ? cast 0 : parent._ref, untyped __cpp__("((wxWindowID)id)"), Point.defaultPositionRef)
You know what, just forget. I'm just getting the same errors over and over again because of ambiguous constructor calls. I'll go back to C# with my editor, and people can use Wine/Crossover if they need to use it on Linux or Mac.
I know it works, because I've tested it (on Windows, anyway):