To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.dev.macOpen lugnet.cad.dev.mac in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / Macintosh / 468
467  |  469
Subject: 
Re: rotating models in MBC 0.4.1d Cocoa
Newsgroups: 
lugnet.cad.dev.mac
Date: 
Wed, 23 Jul 2003 20:23:49 GMT
Viewed: 
1634 times
  
In lugnet.cad.dev.mac, Andrew Allan wrote:
  What seems to happen is that during the rotation my computer decides
to try to render the whole model instead of continuing with the low
complexity rotation.

This is a problem I've been wrestling with since I commenced with Objective-C.
Normally to engage slow drawing mode what I do is I time the redraw operation by
using glFinish(). This command is supposed to prevent the application from
continuing until all OpenGL commands have been executed. It works fine in
classic and carbon environments, however in cocoa it doesn't appear to work at
all, since control appears to be returned to the program instantly.

I'm not sure I completely understand the above.  What are you timing?  If you
are just timing how long the glFinish takes, then a change in its behavior might
not be indicative of a bug in the new OpenGL drivers.  And if you time how long
you have spent since the same point in your rendering loop from the previous
frame, then it really shouldn't matter if the glFinish is working properly.
Your program shouldn't be allowed to get ahead by more than a single buffer
swap, so at most you should be one frame late in realizing that the redraw is
slow.

Note that I haven't done any Cocoa OpenGL programming, but if you want to know
how long it takes to draw a single frame, you generally need to grab a single
time reading for each frame, and just compare the current one to the last frame.
Taking a reading at the "beginning" and "end" of the frame can lead to less
predictable results.  Of course, for the first frame, you have to take your
initial reading at the beginning of the frame, because you have no previous
frame to judge against.

--Travis Cobbs (tcobbs@REMOVE.halibut.com)



Message has 1 Reply:
  Re: rotating models in MBC 0.4.1d Cocoa
 
Travis, To date I have used this apporach in both C and Objective-C: The mouse drag subroutine on the first loop through saves the current system time in a global variable. An event is then sent to initiate redrawing of the model. The the model is (...) (21 years ago, 23-Jul-03, to lugnet.cad.dev.mac)

Message is in Reply To:
  Re: rotating models in MBC 0.4.1d Cocoa
 
(...) This is a problem I've been wrestling with since I commenced with Objective-C. Normally to engage slow drawing mode what I do is I time the redraw operation by using glFinish(). This command is supposed to prevent the application from (...) (21 years ago, 23-Jul-03, to lugnet.cad.dev.mac)

7 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