\hypertarget{glview_example_01_8c-example}{}\doxysection{glview\+\_\+example\+\_\+01.\+c}

\begin{DoxyCodeInclude}{0}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Elementary.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <Evas\_GL.h>}}
\DoxyCodeLine{\textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{typedef} \textcolor{keyword}{struct }\_GLData GLData;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// GL related data here..}}
\DoxyCodeLine{\textcolor{keyword}{struct }\_GLData}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *glapi;}
\DoxyCodeLine{   GLuint       program;}
\DoxyCodeLine{   GLuint       vtx\_shader;}
\DoxyCodeLine{   GLuint       fgmt\_shader;}
\DoxyCodeLine{   GLuint       vbo;}
\DoxyCodeLine{   \textcolor{keywordtype}{int}          initialized : 1;}
\DoxyCodeLine{\};}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{float} red = 1.0;}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{//-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\/-\///}}
\DoxyCodeLine{\textcolor{comment}{// a helper function to load shaders from a shader source}}
\DoxyCodeLine{\textcolor{keyword}{static} GLuint}
\DoxyCodeLine{load\_shader( GLData *gld, GLenum type, \textcolor{keyword}{const} \textcolor{keywordtype}{char} *shader\_src )}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *gl = gld-\/>glapi;}
\DoxyCodeLine{   GLuint shader;}
\DoxyCodeLine{   GLint compiled;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// Create the shader object}}
\DoxyCodeLine{   shader = gl-\/>glCreateShader(type);}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (shader==0)}
\DoxyCodeLine{     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// Load/Compile shader source}}
\DoxyCodeLine{   gl-\/>glShaderSource(shader, 1, \&shader\_src, NULL);}
\DoxyCodeLine{   gl-\/>glCompileShader(shader);}
\DoxyCodeLine{   gl-\/>glGetShaderiv(shader, GL\_COMPILE\_STATUS, \&compiled);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!compiled)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        GLint info\_len = 0;}
\DoxyCodeLine{        gl-\/>glGetShaderiv(shader, GL\_INFO\_LOG\_LENGTH, \&info\_len);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (info\_len > 1)}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             \textcolor{keywordtype}{char}* info\_log = malloc(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{char}) * info\_len);}
\DoxyCodeLine{}
\DoxyCodeLine{             gl-\/>glGetShaderInfoLog(shader, info\_len, NULL, info\_log);}
\DoxyCodeLine{             printf(\textcolor{stringliteral}{"Error compiling shader:\(\backslash\)n\%s\(\backslash\)n======\(\backslash\)n\%s\(\backslash\)n======\(\backslash\)n"}, info\_log, shader\_src );}
\DoxyCodeLine{             free(info\_log);}
\DoxyCodeLine{          \}}
\DoxyCodeLine{        gl-\/>glDeleteShader(shader);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} shader;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// Initialize the shader and program object}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{init\_shaders(GLData *gld)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *gl = gld-\/>glapi;}
\DoxyCodeLine{   GLbyte vShaderStr[] =}
\DoxyCodeLine{      \textcolor{stringliteral}{"attribute vec4 vPosition;    \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"void main()                  \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"\{                            \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"   gl\_Position = vPosition;  \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"\}                            \(\backslash\)n"};}
\DoxyCodeLine{}
\DoxyCodeLine{   GLbyte fShaderStr[] =}
\DoxyCodeLine{      \textcolor{stringliteral}{"\#ifdef GL\_ES                                 \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"precision mediump float;                     \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"\#endif                                       \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"void main()                                  \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"\{                                            \(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"  gl\_FragColor = vec4 ( 1.0, 0.0, 0.0, 1.0 );\(\backslash\)n"}}
\DoxyCodeLine{      \textcolor{stringliteral}{"\}                                            \(\backslash\)n"};}
\DoxyCodeLine{}
\DoxyCodeLine{   GLint linked;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// Load the vertex/fragment shaders}}
\DoxyCodeLine{   gld-\/>vtx\_shader  = load\_shader(gld, GL\_VERTEX\_SHADER, (\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)vShaderStr);}
\DoxyCodeLine{   gld-\/>fgmt\_shader = load\_shader(gld, GL\_FRAGMENT\_SHADER, (\textcolor{keyword}{const} \textcolor{keywordtype}{char}*)fShaderStr);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// Create the program object}}
\DoxyCodeLine{   gld-\/>program = gl-\/>glCreateProgram( );}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (gld-\/>program==0)}
\DoxyCodeLine{     \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glAttachShader(gld-\/>program, gld-\/>vtx\_shader);}
\DoxyCodeLine{   gl-\/>glAttachShader(gld-\/>program, gld-\/>fgmt\_shader);}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glBindAttribLocation(gld-\/>program, 0, \textcolor{stringliteral}{"vPosition"});}
\DoxyCodeLine{   gl-\/>glLinkProgram(gld-\/>program);}
\DoxyCodeLine{   gl-\/>glGetProgramiv(gld-\/>program, GL\_LINK\_STATUS, \&linked);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!linked)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        GLint info\_len = 0;}
\DoxyCodeLine{        gl-\/>glGetProgramiv(gld-\/>program, GL\_INFO\_LOG\_LENGTH, \&info\_len);}
\DoxyCodeLine{        \textcolor{keywordflow}{if} (info\_len > 1)}
\DoxyCodeLine{          \{}
\DoxyCodeLine{             \textcolor{keywordtype}{char}* info\_log = malloc(\textcolor{keyword}{sizeof}(\textcolor{keywordtype}{char}) * info\_len);}
\DoxyCodeLine{}
\DoxyCodeLine{             gl-\/>glGetProgramInfoLog(gld-\/>program, info\_len, NULL, info\_log);}
\DoxyCodeLine{             printf(\textcolor{stringliteral}{"Error linking program:\(\backslash\)n\%s\(\backslash\)n"}, info\_log);}
\DoxyCodeLine{             free(info\_log);}
\DoxyCodeLine{          \}}
\DoxyCodeLine{        gl-\/>glDeleteProgram(gld-\/>program);}
\DoxyCodeLine{        \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 1;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// Callbacks}}
\DoxyCodeLine{\textcolor{comment}{// intialize callback that gets called once for intialization}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_init\_gl(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   GLData *gld = \mbox{\hyperlink{group__Evas__Object__Group__Extras_gafbad43015793eda4ae50202c0ce0e652}{evas\_object\_data\_get}}(obj, \textcolor{stringliteral}{"gld"});}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *gl = gld-\/>glapi;}
\DoxyCodeLine{   GLfloat vVertices[] = \{}
\DoxyCodeLine{        0.0f,  0.5f, 0.0f,}
\DoxyCodeLine{        -\/0.5f, -\/0.5f, 0.0f,}
\DoxyCodeLine{        0.5f, -\/0.5f, 0.0f \};}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!init\_shaders(gld))}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Error Initializing Shaders\(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glGenBuffers(1, \&gld-\/>vbo);}
\DoxyCodeLine{   gl-\/>glBindBuffer(GL\_ARRAY\_BUFFER, gld-\/>vbo);}
\DoxyCodeLine{   gl-\/>glBufferData(GL\_ARRAY\_BUFFER, 3 * 3 * 4, vVertices, GL\_STATIC\_DRAW);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// delete callback gets called when glview is deleted}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_del\_gl(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   GLData *gld = \mbox{\hyperlink{group__Evas__Object__Group__Extras_gafbad43015793eda4ae50202c0ce0e652}{evas\_object\_data\_get}}(obj, \textcolor{stringliteral}{"gld"});}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!gld)}
\DoxyCodeLine{     \{}
\DoxyCodeLine{        printf(\textcolor{stringliteral}{"Unable to get GLData. \(\backslash\)n"});}
\DoxyCodeLine{        \textcolor{keywordflow}{return};}
\DoxyCodeLine{     \}}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *gl = gld-\/>glapi;}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glDeleteShader(gld-\/>vtx\_shader);}
\DoxyCodeLine{   gl-\/>glDeleteShader(gld-\/>fgmt\_shader);}
\DoxyCodeLine{   gl-\/>glDeleteProgram(gld-\/>program);}
\DoxyCodeLine{   gl-\/>glDeleteBuffers(1, \&gld-\/>vbo);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Extras_gabcd8fb64a5133c6be642fd8770c8a5c9}{evas\_object\_data\_del}}((\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}*)obj, \textcolor{stringliteral}{"..gld"});}
\DoxyCodeLine{   free(gld);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// resize callback gets called every time object is resized}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_resize\_gl(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \textcolor{keywordtype}{int} w, h;}
\DoxyCodeLine{   GLData *gld = \mbox{\hyperlink{group__Evas__Object__Group__Extras_gafbad43015793eda4ae50202c0ce0e652}{evas\_object\_data\_get}}(obj, \textcolor{stringliteral}{"gld"});}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *gl = gld-\/>glapi;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__GLView_ga58a8ed33d880aaad30a52aad3b221d9b}{elm\_glview\_size\_get}}(obj, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// GL Viewport stuff. you can avoid doing this if viewport is all the}}
\DoxyCodeLine{   \textcolor{comment}{// same as last frame if you want}}
\DoxyCodeLine{   gl-\/>glViewport(0, 0, w, h);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// draw callback is where all the main GL rendering happens}}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_draw\_gl(\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{struct__Evas__GL__API}{Evas\_GL\_API}} *gl = elm\_glview\_gl\_api\_get(obj);}
\DoxyCodeLine{   GLData *gld = \mbox{\hyperlink{group__Evas__Object__Group__Extras_gafbad43015793eda4ae50202c0ce0e652}{evas\_object\_data\_get}}(obj, \textcolor{stringliteral}{"gld"});}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!gld) \textcolor{keywordflow}{return};}
\DoxyCodeLine{   \textcolor{keywordtype}{int} w, h;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__GLView_ga58a8ed33d880aaad30a52aad3b221d9b}{elm\_glview\_size\_get}}(obj, \&w, \&h);}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glViewport(0, 0, w, h);}
\DoxyCodeLine{   gl-\/>glClearColor(red,0.8,0.3,1);}
\DoxyCodeLine{   gl-\/>glClear(GL\_COLOR\_BUFFER\_BIT);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// Draw a Triangle}}
\DoxyCodeLine{   gl-\/>glEnable(GL\_BLEND);}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glUseProgram(gld-\/>program);}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glBindBuffer(GL\_ARRAY\_BUFFER, gld-\/>vbo);}
\DoxyCodeLine{   gl-\/>glVertexAttribPointer(0, 3, GL\_FLOAT, GL\_FALSE,}
\DoxyCodeLine{                             0, 0);}
\DoxyCodeLine{   gl-\/>glEnableVertexAttribArray(0);}
\DoxyCodeLine{}
\DoxyCodeLine{   gl-\/>glDrawArrays(GL\_TRIANGLES, 0, 3);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// Optional -\/ Flush the GL pipeline}}
\DoxyCodeLine{   gl-\/>glFinish();}
\DoxyCodeLine{}
\DoxyCodeLine{   red -\/= 0.1;}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (red < 0.0) red = 1.0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{comment}{// just need to notify that glview has changed so it can render}}
\DoxyCodeLine{\textcolor{keyword}{static} \mbox{\hyperlink{group__Eina__Types__Group_ga3fe0caf72e93b1bab1ca8ee3ccf3f226}{Eina\_Bool}}}
\DoxyCodeLine{\_anim(\textcolor{keywordtype}{void} *data)}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__GLView_ga1e1544c2e0a7531f07e8cae105c38e3b}{elm\_glview\_changed\_set}}(data);}
\DoxyCodeLine{   \textcolor{keywordflow}{return} \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}};}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_on\_done(\textcolor{keywordtype}{void} *data, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{void} *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga7e7a625dab7a3890532aa13b43117076}{evas\_object\_del}}((\mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}}*)data);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_gabada1ccecc6a712df48e90cbf9915c35}{elm\_exit}}();}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{\textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\_del(\textcolor{keywordtype}{void} *data \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{group__Evas__Canvas_ga5ff87cc4ce6bc43e3b640a6d37f73043}{Evas}} *evas \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *obj, \textcolor{keywordtype}{void} *event\_info \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   Ecore\_Animator *ani = \mbox{\hyperlink{group__Evas__Object__Group__Extras_gafbad43015793eda4ae50202c0ce0e652}{evas\_object\_data\_get}}(obj, \textcolor{stringliteral}{"ani"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Ecore__Animator__Group_gaadfa590f3c1638035393ed9d7aa10e2f}{ecore\_animator\_del}}(ani);}
\DoxyCodeLine{\}}
\DoxyCodeLine{}
\DoxyCodeLine{EAPI\_MAIN \textcolor{keywordtype}{int}}
\DoxyCodeLine{elm\_main(\textcolor{keywordtype}{int} argc \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}}, \textcolor{keywordtype}{char} **argv \mbox{\hyperlink{group__Eina__Types__Group_ga82d751be730f849719ca292f9558be87}{EINA\_UNUSED}})}
\DoxyCodeLine{\{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group_ga9e19e6dd1f517a0ba437c0114d3e7c97}{Evas\_Object}} *win, *bx, *bt, *gl;}
\DoxyCodeLine{   Ecore\_Animator *ani;}
\DoxyCodeLine{   GLData *gld = NULL;}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{if} (!(gld = calloc(1, \textcolor{keyword}{sizeof}(GLData)))) \textcolor{keywordflow}{return} 1;}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_ga7a05f37fd3a019da5e26c5fc91fcd937}{elm\_policy\_set}}(\mbox{\hyperlink{group__Elm__General_ggaa16f3378ecdbf660fa378402e3c5a0a9a02fadb6faada04b19d0fa42c11a8d32a}{ELM\_POLICY\_QUIT}}, \mbox{\hyperlink{group__Elm__General_gga46af37e6ac2c406321060be827117196abbe0962d88ae12afe1a173da881f56cd}{ELM\_POLICY\_QUIT\_LAST\_WINDOW\_CLOSED}});}
\DoxyCodeLine{}
\DoxyCodeLine{   win = \mbox{\hyperlink{group__Elm__Win_gac75d7752662fab73d6420706ce5be996}{elm\_win\_util\_standard\_add}}(\textcolor{stringliteral}{"glview simple"}, \textcolor{stringliteral}{"GLView Simple"});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga9a16a2f8c9fd5b6e9203ed9dcb53ea8b}{elm\_win\_autodel\_set}}(win, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   bx = \mbox{\hyperlink{group__Elm__Box_ga3d0998b60ada633bacfa8869a921cfd7}{elm\_box\_add}}(win);}
\DoxyCodeLine{   evas\_object\_size\_hint\_weight\_set(bx, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Win_ga505d6bd217e5ee01e82b548ec35986eb}{elm\_win\_resize\_object\_add}}(win, bx);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bx);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{//-\///-\///-\/// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)}}
\DoxyCodeLine{   \textcolor{comment}{//-\///}}
\DoxyCodeLine{   \textcolor{comment}{// create a new glview object}}
\DoxyCodeLine{   gl = \mbox{\hyperlink{group__Elm__GLView_ga2ab32b7aee3433992b3f0edba5909a42}{elm\_glview\_add}}(win);}
\DoxyCodeLine{   gld-\/>glapi = elm\_glview\_gl\_api\_get(gl);}
\DoxyCodeLine{   evas\_object\_size\_hint\_align\_set(gl, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}});}
\DoxyCodeLine{   evas\_object\_size\_hint\_weight\_set(gl, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}});}
\DoxyCodeLine{   \textcolor{comment}{// mode is simply for supporting alpha, depth buffering, and stencil}}
\DoxyCodeLine{   \textcolor{comment}{// buffering.}}
\DoxyCodeLine{   elm\_glview\_mode\_set(gl, \mbox{\hyperlink{group__Elm__GLView_gga4d0a2281e13c66d7274987ef24e7abe7a00c61dd95cd14bfb20b575e85913990a}{ELM\_GLVIEW\_ALPHA}} | \mbox{\hyperlink{group__Elm__GLView_gga4d0a2281e13c66d7274987ef24e7abe7ae9ce1787f812b721ab0403ebaad3e442}{ELM\_GLVIEW\_DEPTH}});}
\DoxyCodeLine{   \textcolor{comment}{// resize policy tells glview what to do with the surface when it}}
\DoxyCodeLine{   \textcolor{comment}{// resizes.  ELM\_GLVIEW\_RESIZE\_POLICY\_RECREATE will tell it to}}
\DoxyCodeLine{   \textcolor{comment}{// destroy the current surface and recreate it to the new size}}
\DoxyCodeLine{   elm\_glview\_resize\_policy\_set(gl, ELM\_GLVIEW\_RESIZE\_POLICY\_RECREATE);}
\DoxyCodeLine{   \textcolor{comment}{// render policy tells glview how it would like glview to render}}
\DoxyCodeLine{   \textcolor{comment}{// gl code. ELM\_GLVIEW\_RENDER\_POLICY\_ON\_DEMAND will have the gl}}
\DoxyCodeLine{   \textcolor{comment}{// calls called in the pixel\_get callback, which only gets called}}
\DoxyCodeLine{   \textcolor{comment}{// if the object is visible, hence ON\_DEMAND.  ALWAYS mode renders}}
\DoxyCodeLine{   \textcolor{comment}{// it despite the visibility of the object.}}
\DoxyCodeLine{   elm\_glview\_render\_policy\_set(gl, ELM\_GLVIEW\_RENDER\_POLICY\_ON\_DEMAND);}
\DoxyCodeLine{   \textcolor{comment}{// initialize callback function gets registered here}}
\DoxyCodeLine{   elm\_glview\_init\_func\_set(gl, \_init\_gl);}
\DoxyCodeLine{   \textcolor{comment}{// delete callback function gets registered here}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__GLView_gae6bc093d6804c3131df752e80aca724c}{elm\_glview\_del\_func\_set}}(gl, \_del\_gl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__GLView_ga4f3cc094a7f467595c6c5d4ebb8a02cd}{elm\_glview\_resize\_func\_set}}(gl, \_resize\_gl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__GLView_ga0a2bcda5d7e37ed2dbfd43da47046f05}{elm\_glview\_render\_func\_set}}(gl, \_draw\_gl);}
\DoxyCodeLine{   \textcolor{comment}{//-\///}}
\DoxyCodeLine{   \textcolor{comment}{//-\///-\///-\/// END GL INIT BLOB}}
\DoxyCodeLine{}
\DoxyCodeLine{   elm\_box\_pack\_end(bx, gl);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(gl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__Focus_ga05e39b5e60ad861c63100c811855ef55}{elm\_object\_focus\_set}}(gl, \mbox{\hyperlink{group__Eina__Types__Group_ga05c12dacc8b4058994df842b41be85fc}{EINA\_TRUE}});}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// animating -\/ just a demo. as long as you trigger an update on the image}}
\DoxyCodeLine{   \textcolor{comment}{// object via elm\_glview\_changed\_set() it will be updated.}}
\DoxyCodeLine{   \textcolor{comment}{//}}
\DoxyCodeLine{   \textcolor{comment}{// NOTE: if you delete gl, this animator will keep running trying to access}}
\DoxyCodeLine{   \textcolor{comment}{// gl so you'd better delete this animator with ecore\_animator\_del().}}
\DoxyCodeLine{   ani = \mbox{\hyperlink{group__Ecore__Animator__Group_gaa1e33b8be9117a26918823c535e429ea}{ecore\_animator\_add}}(\_anim, gl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga70134a7068c9bff4107a761abe0a2ad4}{evas\_object\_data\_set}}(gl, \textcolor{stringliteral}{"ani"}, ani);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Extras_ga70134a7068c9bff4107a761abe0a2ad4}{evas\_object\_data\_set}}(gl, \textcolor{stringliteral}{"gld"}, gld);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Events_ga23be30ac5cdfb780f1ff82e9108ec26b}{evas\_object\_event\_callback\_add}}(gl, \mbox{\hyperlink{Evas__Common_8h_ad64cde0da38a60e7cb7905b3ab216968a4471afbcbb4a754b7b0bbde00fb9a277}{EVAS\_CALLBACK\_DEL}}, \_del, gl);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// add an 'OK' button to end the program}}
\DoxyCodeLine{   bt = \mbox{\hyperlink{group__Elm__Button_ga0021b9d86d822367035843ed18bc6ea9}{elm\_button\_add}}(win);}
\DoxyCodeLine{   elm\_object\_text\_set(bt, \textcolor{stringliteral}{"OK"});}
\DoxyCodeLine{   evas\_object\_size\_hint\_align\_set(bt, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}}, \mbox{\hyperlink{Evas__Common_8h_aecbac710f36d52911fc34dcdaf8e729c}{EVAS\_HINT\_FILL}});}
\DoxyCodeLine{   evas\_object\_size\_hint\_weight\_set(bt, \mbox{\hyperlink{Evas__Common_8h_aa47c85083d3dae0111c21ec49359306a}{EVAS\_HINT\_EXPAND}}, 0.0);}
\DoxyCodeLine{   elm\_box\_pack\_end(bx, bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(bt);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Smart__Object__Group_ga18a8b179f94d21b2b09e19db11741061}{evas\_object\_smart\_callback\_add}}(bt, \textcolor{stringliteral}{"clicked"}, \_on\_done, win);}
\DoxyCodeLine{}
\DoxyCodeLine{   evas\_object\_resize(win, 320, 480);}
\DoxyCodeLine{   \mbox{\hyperlink{group__Evas__Object__Group__Basic_ga9cbc13661584e49fb9d9cdab514a1eeb}{evas\_object\_show}}(win);}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{comment}{// run the mainloop and process events and callbacks}}
\DoxyCodeLine{   \mbox{\hyperlink{group__Elm__General_gadf2553f83e6b0b9c7fbe054019a664a1}{elm\_run}}();}
\DoxyCodeLine{}
\DoxyCodeLine{   \textcolor{keywordflow}{return} 0;}
\DoxyCodeLine{\}}
\DoxyCodeLine{\mbox{\hyperlink{group__Elm__General_ga50fe52d513f7e89c9c770afd76de7ad9}{ELM\_MAIN}}()}
\end{DoxyCodeInclude}
 