summaryrefslogtreecommitdiffstats
path: root/minuitwrp/resources.c
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2015-02-11 01:07:44 +0100
committerEthan Yonker <dees_troy@teamw.in>2015-02-11 01:07:44 +0100
commit727aeb8f70c9920029a6e19017cce9608673cdb7 (patch)
treef96bf07dddadfcb7b1992ae1322750dff7104e32 /minuitwrp/resources.c
parentScale the GUI to fit the screen (diff)
downloadandroid_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.tar
android_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.tar.gz
android_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.tar.bz2
android_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.tar.lz
android_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.tar.xz
android_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.tar.zst
android_bootable_recovery-727aeb8f70c9920029a6e19017cce9608673cdb7.zip
Diffstat (limited to '')
-rw-r--r--minuitwrp/resources.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/minuitwrp/resources.c b/minuitwrp/resources.c
index eef5713a1..680bf56a3 100644
--- a/minuitwrp/resources.c
+++ b/minuitwrp/resources.c
@@ -365,9 +365,7 @@ void res_free_surface(gr_surface surface) {
// Scale image function
int res_scale_surface(gr_surface source, gr_surface* destination, float scale_w, float scale_h) {
- GGLContext *sc_context = 0;
- gglInit(&sc_context);
- GGLContext *gl = sc_context;
+ GGLContext *gl = NULL;
GGLSurface* sc_mem_surface = NULL;
*destination = NULL;
GGLSurface *surface = (GGLSurface*)source;
@@ -384,7 +382,8 @@ int res_scale_surface(gr_surface source, gr_surface* destination, float scale_w,
}
sc_mem_surface->format = surface->format;
- // Finish initializing the context
+ // Initialize the context
+ gglInit(&gl);
gl->colorBuffer(gl, sc_mem_surface);
gl->activeTexture(gl, 0);
@@ -429,6 +428,8 @@ int res_scale_surface(gr_surface source, gr_surface* destination, float scale_w,
// draw / scale the source surface to our target context
gl->recti(gl, dx, dy, dx + dw, dy + dh);
+ gglUninit(gl);
+ gl = NULL;
// put the scaled surface in our destination
*destination = (gr_surface*) sc_mem_surface;
// free memory used in the source