JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
TextRendererTraceGL2Mock01.java
Go to the documentation of this file.
1/**
2 * Copyright 2011 JogAmp Community. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without modification, are
5 * permitted provided that the following conditions are met:
6 *
7 * 1. Redistributions of source code must retain the above copyright notice, this list of
8 * conditions and the following disclaimer.
9 *
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
15 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
21 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
22 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 *
24 * The views and conclusions contained in the software and documentation are those of the
25 * authors and should not be interpreted as representing official policies, either expressed
26 * or implied, of JogAmp Community.
27 */
28
29package com.jogamp.opengl.test.junit.jogl.awt.text;
30
31import java.io.PrintStream;
32import java.nio.Buffer;
33import java.nio.ByteBuffer;
34import java.nio.IntBuffer;
35
36import com.jogamp.opengl.GL2;
37import com.jogamp.opengl.TraceGL2;
38
39import com.jogamp.common.nio.Buffers;
40
41/*
42 * Unit tests for Bug464
43 * Modified Version of TraceGL2 for unit test TestAWTTextRendererUseVertexArrayBug464.
44 * This class overrides all glFunctions related to VBO's according to
45 * http://code.google.com/p/glextensions/wiki/GL_ARB_vertex_buffer_object:
46 * glBindBuffer (glBindBufferARB)
47 * glDeleteBuffers (glDeleteBuffersARB)
48 * glGenBuffers (glGenBuffersARB)
49 * glIsBuffer (glIsBufferARB)
50 * glBufferData (glBufferDataARB)
51 * glBufferSubData (glBufferSubDataARB)
52 * glGetBufferSubData (glGetBufferSubDataARB)
53 * glMapBuffer (glMapBufferARB)
54 * glUnmapBuffer (glUnmapBufferARB)
55 * glGetBufferParameteriv (glGetBufferParameterivARB)
56 * glGetBufferPointerv (glGetBufferPointervARB)
57 * Calls to the overridden methods are logged to the disallowedMethodCalls variable of
58 * the GLEventListener instead of being passed to the downstreamGL object.
59 *
60 * Other classes related to this test:
61 * TestAWTTextRendererUseVertexArrayBug464
62 * TextRendererGLEventListener01
63 */
64
66
68
69 public TextRendererTraceGL2Mock01(final GL2 downstreamGL2, final PrintStream stream, final TextRendererGLEventListener01 listener) {
70 super(downstreamGL2, stream);
71 this.listener = listener;
72 }
73
74 @Override
75 public void glGetBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3) {
76 listener.disallowedMethodCalled("glGetBufferSubData");
77 }
78
79 @Override
80 public ByteBuffer glMapBuffer(final int arg0, final int arg1) {
81 listener.disallowedMethodCalled("glMapBuffer");
82 return Buffers.newDirectByteBuffer(0);
83 }
84
85 @Override
86 public void glGetBufferParameteriv(final int arg0, final int arg1, final IntBuffer arg2) {
87 listener.disallowedMethodCalled("glGetBufferParameteriv");
88 }
89
90 @Override
91 public boolean glUnmapBuffer(final int arg0) {
92 listener.disallowedMethodCalled("glUnmapBuffer");
93 return false;
94 }
95
96 @Override
97 public void glGenBuffers(final int arg0, final IntBuffer arg1) {
98 listener.disallowedMethodCalled("glGenBuffers");
99 }
100
101 @Override
102 public void glGenBuffers(final int arg0, final int[] arg1, final int arg2) {
103 listener.disallowedMethodCalled("glGenBuffers");
104 }
105
106 @Override
107 public boolean glIsBuffer(final int arg0) {
108 listener.disallowedMethodCalled("glIsBuffer");
109 return false;
110 }
111
112 @Override
113 public void glBindBuffer(final int arg0, final int arg1) {
114 listener.disallowedMethodCalled("glBindBuffer");
115 }
116
117 @Override
118 public void glDeleteBuffers(final int arg0, final int[] arg1, final int arg2) {
119 listener.disallowedMethodCalled("glDeleteBuffers");
120 }
121
122 @Override
123 public void glBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3) {
124 listener.disallowedMethodCalled("glBufferSubData");
125 }
126
127 @Override
128 public void glGetBufferParameteriv(final int arg0, final int arg1, final int[] arg2, final int arg3) {
129 listener.disallowedMethodCalled("glGetBufferParameteriv");
130 }
131
132 @Override
133 public void glBufferData(final int arg0, final long arg1, final Buffer arg2, final int arg3) {
134 listener.disallowedMethodCalled("glBufferData");
135 }
136
137}
void glGenBuffers(final int arg0, final IntBuffer arg1)
Entry point to C language function: void {@native glGenBuffers}(GLsizei n, GLuint * buffers) Part ...
void glGetBufferParameteriv(final int arg0, final int arg1, final int[] arg2, final int arg3)
Entry point to C language function: void {@native glGetBufferParameteriv}(GLenum target,...
ByteBuffer glMapBuffer(final int arg0, final int arg1)
Entry point to C language function: void * {@native glMapBuffer}(GLenum target, GLenum access) Par...
void glBufferData(final int arg0, final long arg1, final Buffer arg2, final int arg3)
Entry point to C language function: void {@native glBufferData}(GLenum target, GLsizeiptr size,...
void glGenBuffers(final int arg0, final int[] arg1, final int arg2)
Entry point to C language function: void {@native glGenBuffers}(GLsizei n, GLuint * buffers) Part ...
void glBindBuffer(final int arg0, final int arg1)
Entry point to C language function: void {@native glBindBuffer}(GLenum target, GLuint buffer) Part...
boolean glIsBuffer(final int arg0)
Entry point to C language function: GLboolean {@native glIsBuffer}(GLuint buffer) Part of GL_VERSI...
void glGetBufferParameteriv(final int arg0, final int arg1, final IntBuffer arg2)
Entry point to C language function: void {@native glGetBufferParameteriv}(GLenum target,...
boolean glUnmapBuffer(final int arg0)
Entry point to C language function: GLboolean {@native glUnmapBuffer}(GLenum target) Part of GL_VE...
void glGetBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3)
Entry point to C language function: void {@native glGetBufferSubData}(GLenum target,...
void glBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3)
Entry point to C language function: void {@native glBufferSubData}(GLenum target,...
TextRendererTraceGL2Mock01(final GL2 downstreamGL2, final PrintStream stream, final TextRendererGLEventListener01 listener)
void glDeleteBuffers(final int arg0, final int[] arg1, final int arg2)
Entry point to C language function: void {@native glDeleteBuffers}(GLsizei n, const GLuint * buffers...