Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b4eb37b2
Commit
b4eb37b2
authored
Dec 20, 2012
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowed opengl to work without opengl shader.
parent
00246f15
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
41 deletions
+39
-41
modules/video_output/opengl.c
modules/video_output/opengl.c
+39
-41
No files found.
modules/video_output/opengl.c
View file @
b4eb37b2
...
...
@@ -236,6 +236,45 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
#endif
#endif
vgl
->
GenBuffers
=
(
PFNGLGENBUFFERSPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGenBuffers"
);
vgl
->
BindBuffer
=
(
PFNGLBINDBUFFERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glBindBuffer"
);
vgl
->
BufferData
=
(
PFNGLBUFFERDATAPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glBufferData"
);
vgl
->
BufferSubData
=
(
PFNGLBUFFERSUBDATAPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glBufferSubData"
);
vgl
->
DeleteBuffers
=
(
PFNGLDELETEBUFFERSPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDeleteBuffers"
);
vgl
->
CreateShader
=
(
PFNGLCREATESHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glCreateShader"
);
vgl
->
ShaderSource
=
(
PFNGLSHADERSOURCEPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glShaderSource"
);
vgl
->
CompileShader
=
(
PFNGLCOMPILESHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glCompileShader"
);
vgl
->
AttachShader
=
(
PFNGLATTACHSHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glAttachShader"
);
vgl
->
GetProgramiv
=
(
PFNGLGETPROGRAMIVPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetProgramiv"
);
vgl
->
GetShaderiv
=
(
PFNGLGETSHADERIVPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetShaderiv"
);
vgl
->
GetProgramInfoLog
=
(
PFNGLGETPROGRAMINFOLOGPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetProgramInfoLog"
);
vgl
->
GetShaderInfoLog
=
(
PFNGLGETSHADERINFOLOGPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetShaderInfoLog"
);
vgl
->
DetachShader
=
(
PFNGLDETACHSHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDetachShader"
);
vgl
->
DeleteShader
=
(
PFNGLDELETESHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDeleteShader"
);
vgl
->
GetUniformLocation
=
(
PFNGLGETUNIFORMLOCATIONPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetUniformLocation"
);
vgl
->
GetAttribLocation
=
(
PFNGLGETATTRIBLOCATIONPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetAttribLocation"
);
vgl
->
VertexAttribPointer
=
(
PFNGLVERTEXATTRIBPOINTERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glVertexAttribPointer"
);
vgl
->
EnableVertexAttribArray
=
(
PFNGLENABLEVERTEXATTRIBARRAYPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glEnableVertexAttribArray"
);
vgl
->
Uniform4fv
=
(
PFNGLUNIFORM4FVPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform4fv"
);
vgl
->
Uniform4f
=
(
PFNGLUNIFORM4FPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform4f"
);
vgl
->
Uniform3i
=
(
PFNGLUNIFORM3IPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform3i"
);
vgl
->
Uniform1i
=
(
PFNGLUNIFORM1IPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform1i"
);
vgl
->
CreateProgram
=
(
PFNGLCREATEPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glCreateProgram"
);
vgl
->
LinkProgram
=
(
PFNGLLINKPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glLinkProgram"
);
vgl
->
UseProgram
=
(
PFNGLUSEPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUseProgram"
);
vgl
->
DeleteProgram
=
(
PFNGLDELETEPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDeleteProgram"
);
if
(
!
vgl
->
CreateShader
||
!
vgl
->
ShaderSource
||
!
vgl
->
CreateProgram
)
supports_shaders
=
false
;
vgl
->
supports_npot
=
HasExtension
(
extensions
,
"GL_ARB_texture_non_power_of_two"
)
||
HasExtension
(
extensions
,
"GL_APPLE_texture_2D_limited_npot"
);
GLint
max_texture_units
=
0
;
glGetIntegerv
(
GL_MAX_TEXTURE_IMAGE_UNITS
,
&
max_texture_units
);
...
...
@@ -289,49 +328,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
}
}
vgl
->
GenBuffers
=
(
PFNGLGENBUFFERSPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGenBuffers"
);
vgl
->
BindBuffer
=
(
PFNGLBINDBUFFERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glBindBuffer"
);
vgl
->
BufferData
=
(
PFNGLBUFFERDATAPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glBufferData"
);
vgl
->
BufferSubData
=
(
PFNGLBUFFERSUBDATAPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glBufferSubData"
);
vgl
->
DeleteBuffers
=
(
PFNGLDELETEBUFFERSPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDeleteBuffers"
);
vgl
->
CreateShader
=
(
PFNGLCREATESHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glCreateShader"
);
vgl
->
ShaderSource
=
(
PFNGLSHADERSOURCEPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glShaderSource"
);
vgl
->
CompileShader
=
(
PFNGLCOMPILESHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glCompileShader"
);
vgl
->
AttachShader
=
(
PFNGLATTACHSHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glAttachShader"
);
vgl
->
GetProgramiv
=
(
PFNGLGETPROGRAMIVPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetProgramiv"
);
vgl
->
GetShaderiv
=
(
PFNGLGETSHADERIVPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetShaderiv"
);
vgl
->
GetProgramInfoLog
=
(
PFNGLGETPROGRAMINFOLOGPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetProgramInfoLog"
);
vgl
->
GetShaderInfoLog
=
(
PFNGLGETSHADERINFOLOGPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetShaderInfoLog"
);
vgl
->
DetachShader
=
(
PFNGLDETACHSHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDetachShader"
);
vgl
->
DeleteShader
=
(
PFNGLDELETESHADERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDeleteShader"
);
vgl
->
GetUniformLocation
=
(
PFNGLGETUNIFORMLOCATIONPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetUniformLocation"
);
vgl
->
GetAttribLocation
=
(
PFNGLGETATTRIBLOCATIONPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glGetAttribLocation"
);
vgl
->
VertexAttribPointer
=
(
PFNGLVERTEXATTRIBPOINTERPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glVertexAttribPointer"
);
vgl
->
EnableVertexAttribArray
=
(
PFNGLENABLEVERTEXATTRIBARRAYPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glEnableVertexAttribArray"
);
vgl
->
Uniform4fv
=
(
PFNGLUNIFORM4FVPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform4fv"
);
vgl
->
Uniform4f
=
(
PFNGLUNIFORM4FPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform4f"
);
vgl
->
Uniform3i
=
(
PFNGLUNIFORM3IPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform3i"
);
vgl
->
Uniform1i
=
(
PFNGLUNIFORM1IPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUniform1i"
);
vgl
->
CreateProgram
=
(
PFNGLCREATEPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glCreateProgram"
);
vgl
->
LinkProgram
=
(
PFNGLLINKPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glLinkProgram"
);
vgl
->
UseProgram
=
(
PFNGLUSEPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glUseProgram"
);
vgl
->
DeleteProgram
=
(
PFNGLDELETEPROGRAMPROC
)
vlc_gl_GetProcAddress
(
vgl
->
gl
,
"glDeleteProgram"
);
vgl
->
chroma
=
vlc_fourcc_GetChromaDescription
(
vgl
->
fmt
.
i_chroma
);
vgl
->
use_multitexture
=
vgl
->
chroma
->
plane_count
>
1
;
vgl
->
supports_npot
=
HasExtension
(
extensions
,
"GL_ARB_texture_non_power_of_two"
)
||
HasExtension
(
extensions
,
"GL_APPLE_texture_2D_limited_npot"
);
if
(
!
vgl
->
CreateShader
||
!
vgl
->
ShaderSource
||
!
vgl
->
CreateProgram
)
{
fprintf
(
stderr
,
"Looks like you don't have all the opengl we need. Driver is %s, giving up
\n
"
,
glGetString
(
GL_VERSION
));
free
(
vgl
);
return
NULL
;
}
/* Texture size */
for
(
unsigned
j
=
0
;
j
<
vgl
->
chroma
->
plane_count
;
j
++
)
{
...
...
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