JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
GLMatrixFunc.java
Go to the documentation of this file.
1/*
2 * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
3 * Copyright 2010 JogAmp Community. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without modification, are
6 * permitted provided that the following conditions are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
12 * of conditions and the following disclaimer in the documentation and/or other materials
13 * provided with the distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
16 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
18 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
21 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
22 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 *
25 * The views and conclusions contained in the software and documentation are those of the
26 * authors and should not be interpreted as representing official policies, either expressed
27 * or implied, of JogAmp Community.
28 */
29
30package com.jogamp.opengl.fixedfunc;
31
32import java.nio.*;
33
34import com.jogamp.opengl.GL;
35
36/**
37 * Subset of OpenGL fixed function pipeline's matrix operations.
38 */
39public interface GLMatrixFunc {
40
41 public static final int GL_MATRIX_MODE = 0x0BA0;
42 /** Matrix mode modelview */
43 public static final int GL_MODELVIEW = 0x1700;
44 /** Matrix mode projection */
45 public static final int GL_PROJECTION = 0x1701;
46 // public static final int GL_TEXTURE = 0x1702; // Use GL.GL_TEXTURE due to ambiguous GL usage
47 /** Matrix access name for modelview */
48 public static final int GL_MODELVIEW_MATRIX = 0x0BA6;
49 /** Matrix access name for projection */
50 public static final int GL_PROJECTION_MATRIX = 0x0BA7;
51 /** Matrix access name for texture */
52 public static final int GL_TEXTURE_MATRIX = 0x0BA8;
53
54 /**
55 * Copy the named matrix into the given storage.
56 * @param pname {@link #GL_MODELVIEW_MATRIX}, {@link #GL_PROJECTION_MATRIX} or {@link #GL_TEXTURE_MATRIX}
57 * @param params the FloatBuffer's position remains unchanged,
58 * which is the same behavior than the native JOGL GL impl
59 */
60 public void glGetFloatv(int pname, java.nio.FloatBuffer params);
61
62 /**
63 * Copy the named matrix to the given storage at offset.
64 * @param pname {@link #GL_MODELVIEW_MATRIX}, {@link #GL_PROJECTION_MATRIX} or {@link #GL_TEXTURE_MATRIX}
65 * @param params storage
66 * @param params_offset storage offset
67 */
68 public void glGetFloatv(int pname, float[] params, int params_offset);
69
70 /**
71 * glGetIntegerv
72 * @param pname {@link #GL_MATRIX_MODE} to receive the current matrix mode
73 * @param params the FloatBuffer's position remains unchanged
74 * which is the same behavior than the native JOGL GL impl
75 */
76 public void glGetIntegerv(int pname, IntBuffer params);
77 public void glGetIntegerv(int pname, int[] params, int params_offset);
78
79 /**
80 * Sets the current matrix mode.
81 * @param mode {@link #GL_MODELVIEW}, {@link #GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}.
82 */
83 public void glMatrixMode(int mode) ;
84
85 /**
86 * Push the current matrix to it's stack, while preserving it's values.
87 * <p>
88 * There exist one stack per matrix mode, i.e. {@link #GL_MODELVIEW}, {@link #GL_PROJECTION} and {@link GL#GL_TEXTURE GL_TEXTURE}.
89 * </p>
90 */
91 public void glPushMatrix();
92
93 /**
94 * Pop the current matrix from it's stack.
95 * @see #glPushMatrix()
96 */
97 public void glPopMatrix();
98
99 /**
100 * Load the current matrix with the identity matrix
101 */
102 public void glLoadIdentity() ;
103
104 /**
105 * Load the current matrix w/ the provided one.
106 * @param params the FloatBuffer's position remains unchanged,
107 * which is the same behavior than the native JOGL GL impl
108 */
109 public void glLoadMatrixf(java.nio.FloatBuffer m) ;
110 /**
111 * Load the current matrix w/ the provided one.
112 */
113 public void glLoadMatrixf(float[] m, int m_offset);
114
115 /**
116 * Multiply the current matrix: [c] = [c] x [m]
117 * @param m the FloatBuffer's position remains unchanged,
118 * which is the same behavior than the native JOGL GL impl
119 */
120 public void glMultMatrixf(java.nio.FloatBuffer m) ;
121 /**
122 * Multiply the current matrix: [c] = [c] x [m]
123 */
124 public void glMultMatrixf(float[] m, int m_offset);
125
126 /**
127 * Translate the current matrix.
128 */
129 public void glTranslatef(float x, float y, float z) ;
130
131 /**
132 * Rotate the current matrix.
133 */
134 public void glRotatef(float angle, float x, float y, float z);
135
136 /**
137 * Scale the current matrix.
138 */
139 public void glScalef(float x, float y, float z) ;
140
141 /**
142 * {@link #glMultMatrixf(FloatBuffer) Multiply} the current matrix with the orthogonal matrix.
143 */
144 public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) ;
145
146 /**
147 * {@link #glMultMatrixf(FloatBuffer) Multiply} the current matrix with the frustum matrix.
148 */
149 public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar);
150
151}
152
Subset of OpenGL fixed function pipeline's matrix operations.
static final int GL_PROJECTION
Matrix mode projection.
void glPushMatrix()
Push the current matrix to it's stack, while preserving it's values.
void glPopMatrix()
Pop the current matrix from it's stack.
void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar)
Multiply the current matrix with the frustum matrix.
void glTranslatef(float x, float y, float z)
Translate the current matrix.
void glGetFloatv(int pname, float[] params, int params_offset)
Copy the named matrix to the given storage at offset.
static final int GL_MODELVIEW_MATRIX
Matrix access name for modelview.
void glGetFloatv(int pname, java.nio.FloatBuffer params)
Copy the named matrix into the given storage.
void glMultMatrixf(float[] m, int m_offset)
Multiply the current matrix: [c] = [c] x [m].
void glRotatef(float angle, float x, float y, float z)
Rotate the current matrix.
void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar)
Multiply the current matrix with the orthogonal matrix.
static final int GL_TEXTURE_MATRIX
Matrix access name for texture.
void glGetIntegerv(int pname, int[] params, int params_offset)
static final int GL_MODELVIEW
Matrix mode modelview.
void glMultMatrixf(java.nio.FloatBuffer m)
Multiply the current matrix: [c] = [c] x [m].
void glScalef(float x, float y, float z)
Scale the current matrix.
void glLoadMatrixf(float[] m, int m_offset)
Load the current matrix w/ the provided one.
static final int GL_PROJECTION_MATRIX
Matrix access name for projection.
void glLoadIdentity()
Load the current matrix with the identity matrix.
void glLoadMatrixf(java.nio.FloatBuffer m)
Load the current matrix w/ the provided one.
void glMatrixMode(int mode)
Sets the current matrix mode.
void glGetIntegerv(int pname, IntBuffer params)
glGetIntegerv