~pmdj/ubuntu/trusty/qemu/2.9+applesmc+fadtv3

« back to all changes in this revision

Viewing changes to ui/sdl2-gl.c

  • Committer: Phil Dennis-Jordan
  • Date: 2017-07-21 08:03:43 UTC
  • mfrom: (1.1.1)
  • Revision ID: phil@philjordan.eu-20170721080343-2yr2vdj7713czahv
New upstream release 2.9.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
    return (QEMUGLContext)sdlctx;
185
185
}
186
186
 
187
 
void sdl2_gl_scanout(DisplayChangeListener *dcl,
188
 
                     uint32_t backing_id, bool backing_y_0_top,
189
 
                     uint32_t backing_width, uint32_t backing_height,
190
 
                     uint32_t x, uint32_t y,
191
 
                     uint32_t w, uint32_t h)
 
187
void sdl2_gl_scanout_disable(DisplayChangeListener *dcl)
 
188
{
 
189
    struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
 
190
 
 
191
    assert(scon->opengl);
 
192
    scon->w = 0;
 
193
    scon->h = 0;
 
194
    scon->tex_id = 0;
 
195
    sdl2_set_scanout_mode(scon, false);
 
196
}
 
197
 
 
198
void sdl2_gl_scanout_texture(DisplayChangeListener *dcl,
 
199
                             uint32_t backing_id,
 
200
                             bool backing_y_0_top,
 
201
                             uint32_t backing_width,
 
202
                             uint32_t backing_height,
 
203
                             uint32_t x, uint32_t y,
 
204
                             uint32_t w, uint32_t h)
192
205
{
193
206
    struct sdl2_console *scon = container_of(dcl, struct sdl2_console, dcl);
194
207
 
202
215
 
203
216
    SDL_GL_MakeCurrent(scon->real_window, scon->winctx);
204
217
 
205
 
    if (scon->tex_id == 0 || scon->w == 0 || scon->h == 0) {
206
 
        sdl2_set_scanout_mode(scon, false);
207
 
        return;
208
 
    }
209
 
 
210
218
    sdl2_set_scanout_mode(scon, true);
211
219
    if (!scon->fbo_id) {
212
220
        glGenFramebuffers(1, &scon->fbo_id);