To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 11088
11087  |  11089
Subject: 
Re: What do LDraw dev people use for multiplatform development
Newsgroups: 
lugnet.cad.dev
Date: 
Tue, 1 Jun 2010 22:28:35 GMT
Viewed: 
38181 times
  
I know you've already mostly decided on a direction, but I figured I'd throw in
my two cents.  LDView takes a different tack for cross-platform support: all the
back-end code is cross-platform C++, but the UI code is platform-specific.  So
my Windows UI is written in Win32 (not MFC, for various reasons), my Mac UI is
written in Cocoa, and my Linux UI is written in Qt.  (The Qt version is
maintained by a separate developer.)

Given that there is a Qt version of LDView, it would seem that the Windows and
Mac versions are a waste of time.  However, I've personally found that doing the
native UIs produces better end quality, and over time I've gotten fairly good at
keeping as much code as possible in the shared portion.  As an example of this,
I have a class in the shared code that purely handles input, and then does all
the processing on that input necessary to decide what to do.  The
platform-specific calls just tell it things like mouseDown(shiftKeyFlags,
location), or keyDown(shiftKeyFlags, keyCode), and it handles the rest,
including notification-based requests for screen redraws.

So, when the user clicks and drags the mouse in the main window of LDView, the
UI code simply sends a mouseDown() call, followed by mouseMove() calls, and the
input handler takes those and does all the rest.  Assuming LDView is in examine
mode, the mouse down location is recorded.  Then, when the first mouseMove()
call comes in, it calculates the deltas, informs the viewer to start rotating at
an appropriate speed, and then sends a redraw request notification.  The UI code
receives the redraw request notification and does whatever is necessary in the
specific UI to force the view to redraw.  The viewer itself checks to see if any
kind of animation is ongoing at the end of its frame draw.  If so, it
immediately request another redraw.  (The actual redraw happens a little later,
or there'd be infinite recursion, but you get the idea.)

This is all predicated on the fact that the actual renderer in LDView is generic
OpenGL code.  It probably wouldn't work so well otherwise, but I personally find
it to work well overall.

--Travis



Message has 1 Reply:
  Re: What do LDraw dev people use for multiplatform development
 
(...) <snip> (...) Thanks for the insight, Actually the more 'local' feel to interfaces is the reason why I'm a bit more leaning towards wxWidgets at the moment, it uses native controls where possible on all platforms. But Qt is clearly more (...) (14 years ago, 2-Jun-10, to lugnet.cad.dev)

Message is in Reply To:
  What do LDraw dev people use for multiplatform development
 
I all, I've been a Delphi programmer both private and work related for over 15 years , but I think it's time to take a dive in the multiplatform world. So in order to get the hang of things I decided to start a new LDraw application in means of a (...) (14 years ago, 27-May-10, to lugnet.cad.dev)

19 Messages in This Thread:









Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR