diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-14 18:57:05 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-14 18:57:05 +0900 |
commit | 1ff3793322585443909d11284457811c461f8de4 (patch) | |
tree | 2ae703afca718f12137ec0a59ec67cfc2383bb2f /pacc/pacc-gl.c | |
parent | 3e9da829c4ea58363a41f0e4e04124d4090ed6f3 (diff) |
pacc: add viewport
Diffstat (limited to 'pacc/pacc-gl.c')
-rw-r--r-- | pacc/pacc-gl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pacc/pacc-gl.c b/pacc/pacc-gl.c index e1463b8..ada045e 100644 --- a/pacc/pacc-gl.c +++ b/pacc/pacc-gl.c @@ -468,6 +468,10 @@ err: return 0; } +static void pacc_viewport_scale(struct pacc_ctx *pc, int scale) { + glViewport(0, 0, pc->w*scale, pc->h*scale); +} + static struct pacc_vtable pacc_gl_vtable = { .pacc_delete = pacc_delete, .gen_buf = pacc_gen_buf, @@ -485,6 +489,7 @@ static struct pacc_vtable pacc_gl_vtable = { .color = pacc_color, .begin_clear = pacc_begin_clear, .draw = pacc_draw, + .viewport_scale = pacc_viewport_scale, }; struct pacc_ctx *pacc_init_gl(int w, int h, struct pacc_vtable *vt) { |