Hi all, I added a new feature from the tuhopuu2, now you can change the resolution in realtime using python, :o .
Note: Linux users must have support for Xrand.
Both files comes with a Rasterizer_example.py code, would be great if someone could make an example for the people that do not know python.
I was trying to port the realtime Shadow mapping, but the new Nvidia driver is not allowing me to do it, so until they do not fix it, I will not restart this work.
Here is the Rasterizer example code:
def setDisplayResolution(width, height, bpp, rate):
"""
Sets the display resolution.
The user's desktop resolution will be restored on Blender exit.
Note: X11 platforms can't set bpp.
Example::
import Rasterizer
Rasterizer.setDisplayResolution(800, 600, 32, 60)
@param width: New display width, in pixels
@type width: integer
@param height: New display height, in pixels
@type height: integer
@param bpp: The colour depth to set the display to: valid values are 8, 16, 24 and 32.
@type bpp: integer
@param rate: The refresh rate to set the display
@type rate: integer
"""
def getCurrentResolution():
"""
Gets the current display resolution.
Example::
import Rasterizer
currentres = Rasterizer.getCurrentResolution()
print "Width: ", currentres[0]
print "Height: ", currentres[1]
print "BPP: ", currentres[2]
print "Refresh Rate: ", currentres[3]
@return: The current display resolution, in the form (width, height, bpp, rate)
@rtype: tuple
"""
def getValidResolutions():
"""
Gets a list of valid display resolutions.
Example::
import Rasterizer
validres = Rasterizer.getValidResolutions()
print "Width\ Height\ BPP\ Refresh Rate"
for res in validres:
print res[0], "\ ", res[1], "\ ", res[2], "\ ", res[3]
@return: A list of valid display resolutions, in the form [(width, height, bpp, rate)]
@rtype: list
"""
Cya