20
20
# along with this program; if not, write to the Free Software
21
21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
22
23
- __title__ = "Impressive"
23
+ __title__ = "Impressive (dual head) "
24
24
__version__ = "0.10.2"
25
25
__author__ = "Martin J. Fiedler"
26
26
@@ -111,7 +111,11 @@ def RunURL(url):
111
111
win32api .ShellExecute (0 , "open" , url , "" , "" , 0 )
112
112
except ImportError :
113
113
MPlayerPath = ""
114
- def GetScreenSize (): return pygame .display .list_modes ()[0 ]
114
+ def GetScreenSize ():
115
+ if True : # DualHead is not set at this point
116
+ return ProjectionFrame .size ()
117
+ else :
118
+ return pygame .display .list_modes ()[0 ]
115
119
def RunURL (url ): print "Error: cannot run URL `%s'" % url
116
120
MPlayerPlatformOptions = [ "-colorkey" , "0x000000" ]
117
121
MPlayerColorKey = True
@@ -140,6 +144,9 @@ def RunURL(url):
140
144
except OSError :
141
145
print >> sys .stderr , "Error: cannot open URL `%s'" % url
142
146
def GetScreenSize ():
147
+ if True : # HACK: DualHead is not set at this point
148
+ return ProjectionFrame .size ()
149
+
143
150
res_re = re .compile (r'\s*(\d+)x(\d+)\s+\d+\.\d+\*' )
144
151
# parse string like
145
152
# LVDS connected 1280x800+1920+0 (normal left inverted right x axis y axis) 287mm x 180mm
@@ -2191,6 +2198,7 @@ def DrawOverlays():
2191
2198
2192
2199
def ClearScreen ():
2193
2200
WholeWindow .glViewport ()
2201
+ # green for debugging glClearColor(0, 255, 0, 0)
2194
2202
glClear (GL_COLOR_BUFFER_BIT )
2195
2203
2196
2204
# draw the complete image of the current page
@@ -3410,16 +3418,22 @@ def main():
3410
3418
3411
3419
# initialize graphics
3412
3420
pygame .init ()
3421
+ print "before detecting screen size"
3422
+ print Fullscreen , UseAutoScreenSize
3413
3423
if Fullscreen and UseAutoScreenSize :
3414
3424
size = GetScreenSize ()
3415
3425
if size :
3416
3426
ScreenWidth , ScreenHeight = size
3427
+ print "Detected screen size: %dx%d pixels" % (ScreenWidth , ScreenHeight )
3417
3428
print >> sys .stderr , "Detected screen size: %dx%d pixels" % (ScreenWidth , ScreenHeight )
3418
3429
flags = OPENGL | DOUBLEBUF
3419
3430
if Fullscreen :
3420
3431
flags |= FULLSCREEN
3421
3432
try :
3422
- pygame .display .set_mode ((ScreenWidth , ScreenHeight ), flags )
3433
+ if Fullscreen and UseAutoScreenSize :
3434
+ pygame .display .set_mode ((0 ,0 ), flags ) # do not change the resolution - it is already OK
3435
+ else :
3436
+ pygame .display .set_mode ((ScreenWidth , ScreenHeight ), flags )
3423
3437
except :
3424
3438
print >> sys .stderr , "FATAL: cannot create rendering surface in the desired resolution (%dx%d)" % (ScreenWidth , ScreenHeight )
3425
3439
sys .exit (1 )
@@ -3710,6 +3724,7 @@ def main():
3710
3724
DrawCurrentPage ()
3711
3725
UpdateCaption (Pcurrent )
3712
3726
DrawPreviewNextSlide ()
3727
+ ClearScreen ()
3713
3728
TransitionTo (1 )
3714
3729
while True :
3715
3730
HandleEvent (pygame .event .wait ())
@@ -4094,6 +4109,7 @@ def ParseOptions(argv):
4094
4109
projection , prompter = arg .split ("," )
4095
4110
ProjectionFrame = FrameCoordinates .parse (projection )
4096
4111
PrompterWholeFrame = FrameCoordinates .parse (prompter )
4112
+ print "ProjectionFrame: " , ProjectionFrame
4097
4113
print "PrompterWholeFrame: " , PrompterWholeFrame
4098
4114
prompter_width = PrompterWholeFrame .width * 9 / 10 / 2
4099
4115
PrompterCurrentFrame = FrameCoordinates (
@@ -4103,7 +4119,7 @@ def ParseOptions(argv):
4103
4119
PrompterWholeFrame .width - PrompterCurrentFrame .width )
4104
4120
PrompterCurrentFrame .adjust_to_aspect_ratio ((4 ,3 ), (5 ,3 ), (0 ,1 ))
4105
4121
PrompterNextFrame .adjust_to_aspect_ratio ((4 ,3 ), (5 ,3 ), (1 ,0 ))
4106
- UseAutoScreenSize = False
4122
+ UseAutoScreenSize = True
4107
4123
except :
4108
4124
opterr ("invalid parameter for --dual-head" )
4109
4125
if opt in ("-R" , "--meshres" ):
0 commit comments