Horde3D

Next-Generation Graphics Engine
It is currently 19.04.2024, 22:43

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Problems on Mac OS
PostPosted: 02.02.2008, 13:59 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
So I have managed to compile the scene editor for Mac (though QT is an absolute pain there it seems), but I don't have it to a usable state due to frequent crashes.

In particular, every time I click in the scene, to try to navigate through the scene, QT dies deep inside the event handling code.

Everything else seems to work, as I can load scenes, edit properties, etc.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 02.02.2008, 15:35 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Sad to hear that,... but since I don't have a Mac available and there don't seem to be such problems under Linux or Windows, I can't really help you.

Maybe you're able to debug the application and try to find the error by yourself. But I will also try to find someone in my circle of acquaintances who has a mac.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 02.02.2008, 21:25 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Volker wrote:
Sad to hear that,... but since I don't have a Mac available and there don't seem to be such problems under Linux or Windows, I can't really help you.

I mainly wondered whether you were doing anything strange with QT's event handling, but I assume that is not the case.
Volker wrote:
Maybe you're able to debug the application and try to find the error by yourself. But I will also try to find someone in my circle of acquaintances who has a mac.

I am giving it a bash, but I have a feeling that it is the QTGL implementation that is to blaim - it is layered over some deprecated Mac APIs, which doesn't look so good. Maybe I will be able to find info on the Mac/QT mailing lists.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 02.02.2008, 21:34 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Quote:
I mainly wondered whether you were doing anything strange with QT's event handling, but I assume that is not the case.

Not that I'm aware. The strange thing is that it occurs in the camera navigation code. I would expect more problems while the scene loading. Can you navigate by pressing w,a,s,d not pressing the mouse button?
The camera navigation is completly done in the GLWidget.cpp, so you may try to comment out the functionality of mousePressEvent, mouseMoveEvent and mouseReleaseEvent and check if it still crashes.

Maybe we can find the code that makes problems this way.

BTW.: Which Qt Version are you using? 4.3.3?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.02.2008, 14:56 
Offline

Joined: 22.11.2007, 17:05
Posts: 707
Location: Boston, MA
Volker wrote:
The strange thing is that it occurs in the camera navigation code. I would expect more problems while the scene loading. Can you navigate by pressing w,a,s,d not pressing the mouse button?

Yes, WASD navigation works fine, as do all the manipulators (move, rotate and scale).

Volker wrote:
The camera navigation is completly done in the GLWidget.cpp, so you may try to comment out the functionality of mousePressEvent, mouseMoveEvent and mouseReleaseEvent and check if it still crashes.

OK, making progress. The problem is in GLWidget::mouseMoveEvent(), and is triggered by the QCursor::setPos() call on line 548. it looks like the setPos call on Mac generates a mouse movement event, which crashes since you are already handling a movement event...

Volker wrote:
BTW.: Which Qt Version are you using? 4.3.3?
I am using the 4.3.3 binaries from TrollTech's site.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: 03.02.2008, 16:52 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Quote:
OK, making progress. The problem is in GLWidget::mouseMoveEvent(), and is triggered by the QCursor::setPos() call on line 548. it looks like the setPos call on Mac generates a mouse movement event, which crashes since you are already handling a movement event...

That's interessting. Seems to be logical since you have pressed the mouse button and so it should be send an event to the widget. I'm wondering why the same problem does not occure under windows or linux.

You may try if the following suggestion fixes the problem:

Include Qt/qapplication.h in GLWidget.cpp



Code:
#include <Qt/qapplication.h>

then in mouseMoveEvent change the code to the following:
Code:
void GLWidget::mouseMoveEvent(QMouseEvent* event)
{   
   static bool ignoreEvents = false;
   if (ignoreEvents)
   {
      event->accept();
      return;
   }

   // jump back to screen center if we want to transform the camera
   if (m_transformationMode == None)
   {
      QPoint centerPos(mapToGlobal(frameGeometry().center()));
      float diffX = event->globalX() - centerPos.x();
      float diffY = event->globalY() - centerPos.y();      
      ignoreEvents = true;   
      QCursor::setPos(centerPos);   
      QApplication::processEvents();
      ignoreEvents = false;
      if (m_controlPressed) // Strafe
         cameraNavigation(diffX * (m_navSpeed / 100), diffY * (m_navSpeed / 100), 0, 0, 0);
      else // Rotate Camera
         cameraNavigation(0, 0, 0, diffX * (m_navSpeed / 100), diffY * (m_navSpeed / 100));
   }
   // Move object
   else if (m_transformationMode == MoveObject)
      translateObject(event->x(), (height() - event->y()));
   // Rotate Object
   else if (m_transformationMode == RotateObject)
      rotateObject(event->x(), height() - event->y());
   // Scale Object
   else if (m_transformationMode == ScaleObject)
      scaleObject(event->x(), height() - event->y());
   event->accept();
}

It's some kind of hack, if someone has a better solution, feel free to post it.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group