Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
d7f66967
Commit
d7f66967
authored
Jul 05, 2012
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
opengl.c: refactor texture enabling and uniform setting
parent
b14280d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
19 deletions
+27
-19
modules/video_output/opengl.c
modules/video_output/opengl.c
+27
-19
No files found.
modules/video_output/opengl.c
View file @
d7f66967
...
...
@@ -779,35 +779,38 @@ static void draw_without_shaders( vout_display_opengl_t *vgl, float *left, float
right
[
0
],
top
[
0
]
};
for
(
unsigned
j
=
0
;
j
<
vgl
->
chroma
->
plane_count
;
j
++
)
{
vgl
->
ActiveTexture
(
GL_TEXTURE0
+
j
);
vgl
->
ClientActiveTexture
(
GL_TEXTURE0
+
j
);
glEnableClientState
(
GL_VERTEX_ARRAY
);
glEnableClientState
(
GL_TEXTURE_COORD_ARRAY
);
glEnable
(
GL_VERTEX_ARRAY
);
glEnable
(
GL_TEXTURE_COORD_ARRAY
);
vgl
->
ActiveTexture
(
GL_TEXTURE0
);
vgl
->
ClientActiveTexture
(
GL_TEXTURE0
);
glEnable
(
vgl
->
tex_target
);
glBindTexture
(
vgl
->
tex_target
,
vgl
->
texture
[
0
][
0
]);
glVertexPointer
(
2
,
GL_FLOAT
,
0
,
vertexCoord
);
glBindTexture
(
vgl
->
tex_target
,
vgl
->
texture
[
0
][
j
]
);
glTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
textureCoord
);
}
vgl
->
ActiveTexture
(
GL_TEXTURE0
);
vgl
->
ClientActiveTexture
(
GL_TEXTURE0
);
glVertexPointer
(
2
,
GL_FLOAT
,
0
,
vertexCoord
);
glDrawArrays
(
GL_TRIANGLE_STRIP
,
0
,
4
);
for
(
unsigned
j
=
0
;
j
<
vgl
->
chroma
->
plane_count
;
j
++
)
{
vgl
->
ActiveTexture
(
GL_TEXTURE0
+
j
);
vgl
->
ClientActiveTexture
(
GL_TEXTURE0
+
j
);
glDisable
(
vgl
->
tex_target
);
glDisable
(
GL_TEXTURE_COORD_ARRAY
);
glDisable
(
GL_VERTEX_ARRAY
);
glDisableClientState
(
GL_TEXTURE_COORD_ARRAY
);
glDisableClientState
(
GL_VERTEX_ARRAY
);
}
vgl
->
ActiveTexture
(
GL_TEXTURE0
);
vgl
->
ClientActiveTexture
(
GL_TEXTURE0
);
}
static
void
draw_with_shaders
(
vout_display_opengl_t
*
vgl
,
float
*
left
,
float
*
top
,
float
*
right
,
float
*
bottom
)
{
vgl
->
UseProgram
(
vgl
->
program
[
0
]);
vgl
->
Uniform4fv
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"coefficient"
),
4
,
vgl
->
local_value
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture0"
),
0
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture1"
),
1
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture2"
),
2
);
const
GLfloat
vertexCoord
[]
=
{
-
1
.
0
,
1
.
0
,
...
...
@@ -887,6 +890,11 @@ int vout_display_opengl_Display(vout_display_opengl_t *vgl,
if
(
vgl
->
program
[
0
]
)
{
vgl
->
UseProgram
(
vgl
->
program
[
0
]);
vgl
->
Uniform4fv
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"coefficient"
),
4
,
vgl
->
local_value
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture0"
),
0
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture1"
),
1
);
vgl
->
Uniform1i
(
vgl
->
GetUniformLocation
(
vgl
->
program
[
0
],
"Texture2"
),
2
);
draw_with_shaders
(
vgl
,
left
,
top
,
right
,
bottom
);
// Change the program for overlays
vgl
->
UseProgram
(
vgl
->
program
[
1
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment