diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2018-08-12 14:52:49 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2018-08-12 14:52:49 +0300 |
commit | dc2d841b7c50565302af2986d62ddbd29c332acd (patch) | |
tree | 324f234e56fde77fb80dfdef0c7c21f01968f71b /source/blender/windowmanager/intern/wm_playanim.c | |
parent | 27b28e437d974ebbafa234205941c07aa0ab546c (diff) | |
parent | 4b6fa4d897a0bb3252b16383492b526d2cef3920 (diff) |
Merge branch 'blender2.8' into hair_guideshair_guides
Diffstat (limited to 'source/blender/windowmanager/intern/wm_playanim.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_playanim.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c index 003932930ed..6317cca8094 100644 --- a/source/blender/windowmanager/intern/wm_playanim.c +++ b/source/blender/windowmanager/intern/wm_playanim.c @@ -28,8 +28,11 @@ /** \file blender/windowmanager/intern/wm_playanim.c * \ingroup wm * + * Animation player for image sequences & video's with sound support. + * Launched in a separate process from Blender's #RENDER_OT_play_rendered_anim + * * \note This file uses ghost directly and none of the WM definitions. - * this could be made into its own module, alongside creator/ + * this could be made into its own module, alongside creator. */ #include <sys/types.h> @@ -66,7 +69,7 @@ #include "GPU_matrix.h" #include "GPU_immediate.h" #include "GPU_immediate_util.h" -#include "GPU_batch.h" +#include "GPU_context.h" #include "GPU_init_exit.h" #include "DNA_scene_types.h" @@ -184,7 +187,7 @@ typedef enum eWS_Qual { static struct WindowStateGlobal { GHOST_SystemHandle ghost_system; void *ghost_window; - Gwn_Context *gwn_context; + GPUContext *gpu_context; /* events */ eWS_Qual qual; @@ -201,8 +204,8 @@ static void playanim_window_get_size(int *r_width, int *r_height) static void playanim_gl_matrix(void) { /* unified matrix, note it affects offset for drawing */ - /* note! cannot use gpuOrtho2D here because shader ignores. */ - gpuOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0, 1.0f); + /* note! cannot use GPU_matrix_ortho_2d_set here because shader ignores. */ + GPU_matrix_ortho_set(0.0f, 1.0f, 0.0f, 1.0f, -1.0, 1.0f); } /* implementation */ @@ -366,25 +369,25 @@ static void playanim_toscreen(PlayState *ps, PlayAnimPict *picture, struct ImBuf float fac = ps->picture->frame / (double)(((PlayAnimPict *)picsbase.last)->frame - ((PlayAnimPict *)picsbase.first)->frame); fac = 2.0f * fac - 1.0f; - gpuPushProjectionMatrix(); - gpuLoadIdentityProjectionMatrix(); - gpuPushMatrix(); - gpuLoadIdentity(); + GPU_matrix_push_projection(); + GPU_matrix_identity_projection_set(); + GPU_matrix_push(); + GPU_matrix_identity_set(); - uint pos = GWN_vertformat_attr_add(immVertexFormat(), "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immUniformColor3ub(0, 255, 0); - immBegin(GWN_PRIM_LINES, 2); + immBegin(GPU_PRIM_LINES, 2); immVertex2f(pos, fac, -1.0f); immVertex2f(pos, fac, 1.0f); immEnd(); immUnbindProgram(); - gpuPopMatrix(); - gpuPopProjectionMatrix(); + GPU_matrix_pop(); + GPU_matrix_pop_projection(); } GHOST_SwapWindowBuffers(g_WS.ghost_window); @@ -1281,7 +1284,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv) //GHOST_ActivateWindowDrawingContext(g_WS.ghost_window); /* initialize OpenGL immediate mode */ - g_WS.gwn_context = GWN_context_create(); + g_WS.gpu_context = GPU_context_create(); GPU_init(); immActivate(); @@ -1552,10 +1555,10 @@ static char *wm_main_playanim_intern(int argc, const char **argv) GPU_shader_free_builtin_shaders(); - if (g_WS.gwn_context) { - GWN_context_active_set(g_WS.gwn_context); - GWN_context_discard(g_WS.gwn_context); - g_WS.gwn_context = NULL; + if (g_WS.gpu_context) { + GPU_context_active_set(g_WS.gpu_context); + GPU_context_discard(g_WS.gpu_context); + g_WS.gpu_context = NULL; } BLF_exit(); |