From 7dff066bb823dddb5d6e0e7672f5599afa5a43b9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 31 Oct 2012 15:16:56 +0100 Subject: Add OSX CALayer OpenGL 3 (core) support: Derive pixelformat from parent (GL3), use GL3.2 compatible shader; Use VBO in general. Covered by: Auto unit tests: TestOffscreenLayer01GLCanvasAWT, TestOffscreenLayer02NewtCanvasAWT Manual: TestGearsES2AWT '-gl3 -layered' --- .../classes/jogamp/opengl/shader/texture01_xxx.fp | 19 +++++++++++++++++++ .../classes/jogamp/opengl/shader/texture01_xxx.vp | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp create mode 100644 src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp (limited to 'src/jogl/classes/jogamp/opengl/shader') diff --git a/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp new file mode 100644 index 000000000..8b30b65f9 --- /dev/null +++ b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.fp @@ -0,0 +1,19 @@ +// Copyright 2012 JogAmp Community. All rights reserved. + +#if __VERSION__ >= 130 + #define varying in + out vec4 mgl_FragColor; + #define texture2D texture +#else + #define mgl_FragColor gl_FragColor +#endif + +varying vec2 mgl_texCoord; + +uniform sampler2D mgl_Texture0; + +void main (void) +{ + mgl_FragColor = texture2D(mgl_Texture0, mgl_texCoord); +} + diff --git a/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp new file mode 100644 index 000000000..d9ef6b493 --- /dev/null +++ b/src/jogl/classes/jogamp/opengl/shader/texture01_xxx.vp @@ -0,0 +1,19 @@ +// Copyright 2012 JogAmp Community. All rights reserved. + +#if __VERSION__ >= 130 + #define attribute in + #define varying out +#endif + +uniform mat4 mgl_PMVMatrix[2]; + +attribute vec4 mgl_Vertex; +attribute vec4 mgl_MultiTexCoord; + +varying vec2 mgl_texCoord; + +void main(void) +{ + mgl_texCoord = mgl_MultiTexCoord.st; + gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex; +} -- cgit v1.2.3