Last active
August 29, 2015 14:23
-
-
Save Hamayama/583f6f226238948ec18e to your computer and use it in GitHub Desktop.
Gauche-glのWindows版の実行エラー2のパッチ(2015-6-13)(2015-6-14修正)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- example9-4_orig.scm 2014-12-29 21:55:10 +0900 | |
+++ example9-4.scm 2015-06-14 21:03:17 +0900 | |
@@ -80,6 +80,11 @@ | |
(glut-init-window-size 250 250) | |
(glut-init-window-position 100 100) | |
(glut-create-window (car args)) | |
+ | |
+ ;; When using GLEW, 'glew-init' must be called after 'glut-create-window' | |
+ ;; to use OpenGL extensions such as 'gl-tex-image-3d'. | |
+ (glew-init) | |
+ | |
(init) | |
(glut-display-func disp) | |
(glut-reshape-func reshape) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- glut-lib_orig.stub 2014-12-29 21:55:10 +0900 | |
+++ glut-lib.stub 2015-06-14 20:58:07 +0900 | |
@@ -57,12 +57,21 @@ | |
(when (< argc 0) (SCM_TYPE_ERROR args "list")) | |
(set! argv (Scm_ListToCStringArray args TRUE NULL)) | |
(glutInit (& argc) argv) | |
- (.if "defined(HAVE_GL_GLEW_H)" | |
- (let* ([r::GLenum (glewInit)]) | |
- (unless (!= r GLEW_OK) | |
- (Scm_Error "Initializing GLEW failed.")))) | |
+ ;; When using GLEW, 'glewInit' must be called after 'glutCreateWindow' | |
+ ;; to use OpenGL extensions such as 'glTexImage3D'. | |
+ ;; Thus, the following code was moved to a new procedure 'glew-init'. | |
+ ;(.if "defined(HAVE_GL_GLEW_H)" | |
+ ; (let* ([r::GLenum (glewInit)]) | |
+ ; (if (!= r GLEW_OK) | |
+ ; (Scm_Error "Initializing GLEW failed.")))) | |
(result (Scm_CStringArrayToList (cast (const char**) argv) argc 0)))) | |
+(define-cproc glew-init () ::<void> | |
+ (.if "defined(HAVE_GL_GLEW_H)" | |
+ (let* ([r::GLenum (glewInit)]) | |
+ (if (!= r GLEW_OK) | |
+ (Scm_Error "Initializing GLEW failed."))))) | |
+ | |
(define-cproc glut-init-display-mode (mode::<fixnum>) | |
::<void> glutInitDisplayMode) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ogl2brick_orig.scm 2014-12-29 21:55:10 +0900 | |
+++ ogl2brick.scm 2015-06-14 21:03:10 +0900 | |
@@ -380,6 +380,10 @@ | |
(glut-init-window-size 500 500) | |
(let* ((window (glut-create-window "3Dlabs Brick Shader"))) | |
+ ;; When using GLEW, 'glew-init' must be called after 'glut-create-window' | |
+ ;; to use OpenGL extensions such as 'gl-create-shader-object-arb'. | |
+ (glew-init) | |
+ | |
(unless (gl-extension-available? 'GL_ARB_shader_objects | |
'GL_ARB_fragment_shader | |
'GL_ARB_vertex_shader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- ogl2particle_orig.scm 2014-12-29 21:55:10 +0900 | |
+++ ogl2particle.scm 2015-06-14 21:03:31 +0900 | |
@@ -407,6 +407,10 @@ | |
(let* ((window (glut-create-window | |
"3Dlabs OpenGL Shading Language Particle System Demo"))) | |
+ ;; When using GLEW, 'glew-init' must be called after 'glut-create-window' | |
+ ;; to use OpenGL extensions such as 'gl-create-shader-object-arb'. | |
+ (glew-init) | |
+ | |
(unless (gl-extension-available? 'GL_ARB_shader_objects | |
'GL_ARB_fragment_shader | |
'GL_ARB_vertex_shader |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment