Skip to content

Commit

Permalink
Changed window creation interface in GLUS. Fixed some bugs in GLUS and
Browse files Browse the repository at this point in the history
Example 14.
  • Loading branch information
McNopper committed Aug 18, 2014
1 parent 25752b1 commit c2af01d
Show file tree
Hide file tree
Showing 113 changed files with 3,123 additions and 2,946 deletions.
1 change: 1 addition & 0 deletions Example01/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
22 changes: 19 additions & 3 deletions Example01/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@ GLUSvoid terminate(GLUSvoid)
*/
int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -68,9 +86,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 0, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions Example02/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
22 changes: 19 additions & 3 deletions Example02/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -137,9 +155,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 0, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
22 changes: 19 additions & 3 deletions Example03/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -266,9 +284,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 0, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions Example04/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
22 changes: 19 additions & 3 deletions Example04/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 24,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -244,9 +262,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 24, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
22 changes: 19 additions & 3 deletions Example05/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 24,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -293,9 +311,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 24, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions Example06/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
22 changes: 19 additions & 3 deletions Example06/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 24,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -291,9 +309,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 24, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions Example07/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
22 changes: 19 additions & 3 deletions Example07/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -370,9 +388,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 0, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
22 changes: 19 additions & 3 deletions Example08/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 24,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -309,9 +327,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 24, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions Example09/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
22 changes: 19 additions & 3 deletions Example09/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 0,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -423,9 +441,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 0, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
22 changes: 19 additions & 3 deletions Example10/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,24 @@ GLUSvoid terminate(GLUSvoid)

int main(int argc, char* argv[])
{
EGLint eglConfigAttributes[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_DEPTH_SIZE, 24,
EGL_STENCIL_SIZE, 0,
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
EGL_NONE
};

EGLint eglContextAttributes[] = {
EGL_CONTEXT_MAJOR_VERSION, 3,
EGL_CONTEXT_MINOR_VERSION, 2,
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE, EGL_TRUE,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
EGL_NONE
};

glusInitFunc(init);

glusReshapeFunc(reshape);
Expand All @@ -215,9 +233,7 @@ int main(int argc, char* argv[])

glusTerminateFunc(terminate);

glusPrepareContext(3, 2, GLUS_FORWARD_COMPATIBLE_BIT);

if (!glusCreateWindow("GLUS Example Window", 640, 480, 24, 0, GLUS_FALSE))
if (!glusCreateWindow("GLUS Example Window", 640, 480, GLUS_FALSE, GLUS_FALSE, eglConfigAttributes, eglContextAttributes))
{
printf("Could not create window!\n");
return -1;
Expand Down
1 change: 1 addition & 0 deletions Example11/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/x86__Windows__MinGW_Debug/
Loading

0 comments on commit c2af01d

Please sign in to comment.