aboutsummaryrefslogtreecommitdiffstats
path: root/Lua/src/media/UVisualizer.pas
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Lua/src/media/UVisualizer.pas20
1 files changed, 13 insertions, 7 deletions
diff --git a/Lua/src/media/UVisualizer.pas b/Lua/src/media/UVisualizer.pas
index 9af6d8c2..b25d68a9 100644
--- a/Lua/src/media/UVisualizer.pas
+++ b/Lua/src/media/UVisualizer.pas
@@ -77,6 +77,7 @@ uses
UGraphic,
UMain,
UConfig,
+ UPath,
ULog;
{$IF PROJECTM_VERSION < 1000000} // < 1.0
@@ -130,7 +131,7 @@ type
function Init(): boolean;
function Finalize(): boolean;
- function Open(const aFileName : string): boolean; // true if succeed
+ function Open(const aFileName: IPath): boolean; // true if succeed
procedure Close;
procedure Play;
@@ -183,7 +184,7 @@ begin
Result := true;
end;
-function TVideoPlayback_ProjectM.Open(const aFileName : string): boolean; // true if succeed
+function TVideoPlayback_ProjectM.Open(const aFileName: IPath): boolean; // true if succeed
begin
Result := false;
end;
@@ -484,7 +485,11 @@ begin
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
- gluOrtho2D(0, 1, 0, 1);
+ // Use count of screens instead of 1 for the right corner
+ // otherwise we would draw the visualization streched over both screens
+ // another point is that we draw over the at this time drawn first
+ // screen, if Screen = 2
+ gluOrtho2D(0, Screens, 0, 1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
@@ -496,11 +501,12 @@ begin
glColor4f(1, 1, 1, 1);
// draw projectM frame
+ // Screen is 1 to 2. So current screen is from (Screen - 1) to (Screen)
glBegin(GL_QUADS);
- glTexCoord2f(0, 0); glVertex2f(0, 0);
- glTexCoord2f(1, 0); glVertex2f(1, 0);
- glTexCoord2f(1, 1); glVertex2f(1, 1);
- glTexCoord2f(0, 1); glVertex2f(0, 1);
+ glTexCoord2f(0, 0); glVertex2f((Screen - 1), 0);
+ glTexCoord2f(1, 0); glVertex2f(Screen, 0);
+ glTexCoord2f(1, 1); glVertex2f(Screen, 1);
+ glTexCoord2f(0, 1); glVertex2f((Screen - 1), 1);
glEnd();
glDisable(GL_TEXTURE_2D);