int (*makeCurrent)(vlc_gl_t *);
void (*releaseCurrent)(vlc_gl_t *);
+ void (*resize)(vlc_gl_t *, unsigned, unsigned);
void (*swap)(vlc_gl_t *);
int (*lock)(vlc_gl_t *);
void (*unlock)(vlc_gl_t *);
gl->unlock(gl);
}
+static inline void vlc_gl_Resize(vlc_gl_t *gl, unsigned w, unsigned h)
+{
+ if (gl->resize != NULL)
+ gl->resize(gl, w, h);
+}
+
static inline void vlc_gl_Swap(vlc_gl_t *gl)
{
gl->swap(gl);
/* Initialize OpenGL callbacks */
gl->makeCurrent = MakeCurrent;
gl->releaseCurrent = ReleaseCurrent;
+ gl->resize = NULL;
gl->swap = SwapBuffers;
gl->getProcAddress = GetSymbol;
gl->lock = NULL;
if (sys->gl == NULL)
goto error;
+ vlc_gl_Resize (sys->gl, cfg.width, cfg.height);
+
/* Initialize video display */
const vlc_fourcc_t *spu_chromas;
vout_display_place_t place;
vout_display_PlacePicture (&place, src, c, false);
+ vlc_gl_Resize (sys->gl, place.width, place.height);
vlc_gl_MakeCurrent (sys->gl);
glViewport (place.x, place.y, place.width, place.height);
vlc_gl_ReleaseCurrent (sys->gl);
gl->sys = sys;
gl->makeCurrent = MakeCurrent;
gl->releaseCurrent = ReleaseCurrent;
+ gl->resize = NULL;
gl->swap = SwapBuffers;
gl->getProcAddress = GetSymbol;
gl->lock = NULL;
vlc_gl_t *gl = vlc_gl_Create(surface, VLC_OPENGL, "glx");
if (gl == NULL) {
vout_window_Delete(surface);
- goto error;
+ return NULL;
}
+
+ vlc_gl_Resize(gl, cfg->width, cfg->height);
return gl;
error:
*height = sys->height;
sys->width = -1;
sys->height = -1;
+
+ vlc_gl_Resize(gl, *width, *height);
ret = true;
}
vlc_mutex_unlock(&sys->lock);