WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-20-2011, 09:45 PM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Question display mode change, getting framerate

Dear All,

I want to force a display mode change and exit out when errors occur, however I am having some trouble with querying the framerate the program runs at (viz.window.getFrameRate() always returns 0). Is the below a good way to do it?

Code:
 # setup display mode
 viz.setDisplayMode(resolution[0], resolution[1], 32, refreshRate)
 viz.setMultiSample(multiSample)
 
 viz.go(mode)
 viz.window.setFullscreen()
 
 # check displayMode set succesfully
 if  viz.window.getFullscreenRectangle()[2] != resolution[0] or \
  viz.window.getFullscreenRectangle()[3] != resolution[1] or \
  viz.window.getFrameRate()     != refreshRate:
  print '\nRequested display mode: '+str(resolution[0])+'x'+str(resolution[1])+'@'+str(refreshRate)+', got: '+str(viz.window.getFullscreenRectangle()[2])+'x'+str(viz.window.getFullscreenRectangle()[3])+'@'+str(viz.window.getFrameRate())
  viz.quit()
  sys.exit(-1)
In a related note, if I put in some ridiculous displaymode settings, Vizard always nicely gives me '** ERROR: Failed to set requested display mode', highlighted in red. Is there any way for me to get my own error messages highlighted in red (the print in the above code could use it)?

Thank you very much!

Best,
Dee
Reply With Quote
  #2  
Old 05-20-2011, 10:24 PM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Quote:
Originally Posted by dcnieho View Post
In a related note, if I put in some ridiculous displaymode settings, Vizard always nicely gives me '** ERROR: Failed to set requested display mode', highlighted in red. Is there any way for me to get my own error messages highlighted in red (the print in the above code could use it)?
To answer this part of my question, I just came across viz.logError(), nice!

Best,
Dee
Reply With Quote
  #3  
Old 05-23-2011, 08:59 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The following code shows how to retrieve the refresh rate of the monitor:
Code:
refresh_rate = viz.getOption('viz.monitor.refresh_rate',type=int)
Reply With Quote
  #4  
Old 05-23-2011, 07:32 PM
dcnieho dcnieho is offline
Member
 
Join Date: Feb 2011
Posts: 59
Ah thanks, that works!

I did try viz.getOption('viz.display.frequency',type=int) before, but that doesn't work as it simply reports the frequency you asked for (however ridiculous), not the current refresh rate... viz.getOption('viz.monitor.refresh_rate',type=int) does exactly what I hoped for.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Viewpoint in different scenes lilio Vizard 1 08-28-2009 02:56 PM
Change model alpha and memory leak hosier Vizard 2 06-25-2009 10:55 AM
Randomly and Continuously Change Avatar's Face Texture Karla Vizard 4 08-22-2008 12:14 PM
Support for Philips IC3D Autostereoscopic display mspusch Vizard 0 07-13-2006 04:14 PM
Text Display bstankie Vizard 1 12-22-2003 03:23 PM


All times are GMT -7. The time now is 09:56 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC