VLC 4.0.0-dev
Loading...
Searching...
No Matches
vlc_opengl.h File Reference

This file defines GL structures and functions. More...

Include dependency graph for vlc_opengl.h:

Go to the source code of this file.

Data Structures

struct  vlc_gl_cfg
 
struct  vlc_gl_operations
 
struct  vlc_gl_t
 

Macros

#define set_callback_opengl_common(activate)
 
#define set_callback_opengl(activate, priority)
 
#define set_callback_opengl_offscreen(activate, priority)
 
#define set_callback_opengl_es2(activate, priority)
 
#define set_callback_opengl_es2_offscreen(activate, priority)
 

Typedefs

typedef struct vlc_gl_t vlc_gl_t
 A VLC GL context (and its underlying surface)
 
typedef int(* vlc_gl_activate) (vlc_gl_t *, unsigned width, unsigned height, const struct vlc_gl_cfg *cfg)
 

Enumerations

enum  vlc_gl_api_type { VLC_OPENGL , VLC_OPENGL_ES2 }
 

Functions

vlc_gl_tvlc_gl_Create (const struct vout_display_cfg *cfg, unsigned flags, const char *name, const struct vlc_gl_cfg *gl_cfg)
 Creates an OpenGL context (and its underlying surface).
 
vlc_gl_tvlc_gl_CreateOffscreen (vlc_object_t *parent, struct vlc_decoder_device *device, unsigned width, unsigned height, unsigned flags, const char *name, const struct vlc_gl_cfg *gl_cfg)
 
void vlc_gl_Delete (vlc_gl_t *)
 
static int vlc_gl_MakeCurrent (vlc_gl_t *gl)
 
static void vlc_gl_ReleaseCurrent (vlc_gl_t *gl)
 
static void vlc_gl_Resize (vlc_gl_t *gl, unsigned w, unsigned h)
 
static void vlc_gl_Swap (vlc_gl_t *gl)
 
static picture_tvlc_gl_SwapOffscreen (vlc_gl_t *gl)
 
static void * vlc_gl_GetProcAddress (vlc_gl_t *gl, const char *name)
 Fetch a symbol or pointer function from the OpenGL implementation.
 
vlc_gl_tvlc_gl_surface_Create (vlc_object_t *, const struct vlc_window_cfg *, struct vlc_window **, const struct vlc_gl_cfg *)
 
bool vlc_gl_surface_CheckSize (vlc_gl_t *, unsigned *w, unsigned *h)
 
void vlc_gl_surface_Destroy (vlc_gl_t *)
 
static bool vlc_gl_StrHasToken (const char *apis, const char *api)
 

Detailed Description

This file defines GL structures and functions.

Macro Definition Documentation

◆ set_callback_opengl

#define set_callback_opengl (   activate,
  priority 
)
Value:
set_capability("opengl", priority)
#define set_callback_opengl_common(activate)
Definition vlc_opengl.h:63

◆ set_callback_opengl_common

#define set_callback_opengl_common (   activate)
Value:
{ \
vlc_gl_activate activate__ = activate; \
(void) activate__; \
set_callback(activate) \
} \
int(* vlc_gl_activate)(vlc_gl_t *, unsigned width, unsigned height, const struct vlc_gl_cfg *cfg)
Definition vlc_opengl.h:60

◆ set_callback_opengl_es2

#define set_callback_opengl_es2 (   activate,
  priority 
)
Value:
set_capability("opengl es2", priority)

◆ set_callback_opengl_es2_offscreen

#define set_callback_opengl_es2_offscreen (   activate,
  priority 
)
Value:
set_capability("opengl es2 offscreen", priority)

◆ set_callback_opengl_offscreen

#define set_callback_opengl_offscreen (   activate,
  priority 
)
Value:
set_capability("opengl offscreen", priority)

Typedef Documentation

◆ vlc_gl_activate

typedef int(* vlc_gl_activate) (vlc_gl_t *, unsigned width, unsigned height, const struct vlc_gl_cfg *cfg)

◆ vlc_gl_t

typedef struct vlc_gl_t vlc_gl_t

A VLC GL context (and its underlying surface)

Enumeration Type Documentation

◆ vlc_gl_api_type

Enumerator
VLC_OPENGL 
VLC_OPENGL_ES2 

Function Documentation

◆ vlc_gl_Create()

vlc_gl_t * vlc_gl_Create ( const struct vout_display_cfg cfg,
unsigned  flags,
const char *  name,
const struct vlc_gl_cfg gl_cfg 
)

Creates an OpenGL context (and its underlying surface).

Note
In most cases, you should vlc_gl_MakeCurrent() afterward.
Parameters
cfginitial configuration (including window to use as OpenGL surface)
flagsOpenGL context type
namemodule name (or NULL for auto)
gl_cfgOpenGL configuration (or NULL for default)
Returns
a new context, or NULL on failure

◆ vlc_gl_CreateOffscreen()

◆ vlc_gl_Delete()

◆ vlc_gl_GetProcAddress()

static void * vlc_gl_GetProcAddress ( vlc_gl_t gl,
const char *  name 
)
inlinestatic

Fetch a symbol or pointer function from the OpenGL implementation.

Return a pointer from the OpenGL implementation, which can be part of either the underlying OpenGL provider or an OpenGL function matching the version requested.

If the symbol name is not matching the underlying implementation of OpenGL, an invalid pointer or NULL can be returned.

Note
This function must be called between MakeCurrent and ReleaseCurrent.
Parameters
glthe OpenGL provider to fetch the function from
namethe symbol name to fetch from the implementation
Returns
A pointer corresponding to the symbol, or a potentially invalid value or NULL in case of error.

References vlc_gl_operations::get_proc_address, name, and vlc_gl_t::ops.

◆ vlc_gl_MakeCurrent()

static int vlc_gl_MakeCurrent ( vlc_gl_t gl)
inlinestatic

◆ vlc_gl_ReleaseCurrent()

static void vlc_gl_ReleaseCurrent ( vlc_gl_t gl)
inlinestatic

◆ vlc_gl_Resize()

static void vlc_gl_Resize ( vlc_gl_t gl,
unsigned  w,
unsigned  h 
)
inlinestatic

◆ vlc_gl_StrHasToken()

static bool vlc_gl_StrHasToken ( const char *  apis,
const char *  api 
)
inlinestatic

◆ vlc_gl_surface_CheckSize()

bool vlc_gl_surface_CheckSize ( vlc_gl_t ,
unsigned *  w,
unsigned *  h 
)

◆ vlc_gl_surface_Create()

vlc_gl_t * vlc_gl_surface_Create ( vlc_object_t ,
const struct vlc_window_cfg ,
struct vlc_window **  ,
const struct vlc_gl_cfg  
)

◆ vlc_gl_surface_Destroy()

◆ vlc_gl_Swap()

static void vlc_gl_Swap ( vlc_gl_t gl)
inlinestatic

◆ vlc_gl_SwapOffscreen()

static picture_t * vlc_gl_SwapOffscreen ( vlc_gl_t gl)
inlinestatic