ReactOS  0.4.12-dev-75-g00dd17e
matrix.h File Reference
#include "glheader.h"
Include dependency graph for matrix.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GLAPIENTRY _mesa_Frustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
 
void GLAPIENTRY _mesa_Ortho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
 
void GLAPIENTRY _mesa_PushMatrix (void)
 
void GLAPIENTRY _mesa_PopMatrix (void)
 
void GLAPIENTRY _mesa_LoadIdentity (void)
 
void GLAPIENTRY _mesa_LoadMatrixf (const GLfloat *m)
 
void GLAPIENTRY _mesa_LoadMatrixd (const GLdouble *m)
 
void GLAPIENTRY _mesa_MatrixMode (GLenum mode)
 
void GLAPIENTRY _mesa_MultMatrixf (const GLfloat *m)
 
void GLAPIENTRY _mesa_MultMatrixd (const GLdouble *m)
 
void GLAPIENTRY _mesa_Rotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
 
void GLAPIENTRY _mesa_Rotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
 
void GLAPIENTRY _mesa_Scalef (GLfloat x, GLfloat y, GLfloat z)
 
void GLAPIENTRY _mesa_Scaled (GLdouble x, GLdouble y, GLdouble z)
 
void GLAPIENTRY _mesa_Translatef (GLfloat x, GLfloat y, GLfloat z)
 
void GLAPIENTRY _mesa_Translated (GLdouble x, GLdouble y, GLdouble z)
 
void GLAPIENTRY _mesa_LoadTransposeMatrixfARB (const GLfloat *m)
 
void GLAPIENTRY _mesa_LoadTransposeMatrixdARB (const GLdouble *m)
 
void GLAPIENTRY _mesa_MultTransposeMatrixfARB (const GLfloat *m)
 
void GLAPIENTRY _mesa_MultTransposeMatrixdARB (const GLdouble *m)
 
void _mesa_init_matrix (struct gl_context *ctx)
 
void _mesa_init_transform (struct gl_context *ctx)
 
void _mesa_free_matrix_data (struct gl_context *ctx)
 
void _mesa_update_modelview_project (struct gl_context *ctx, GLuint newstate)
 

Function Documentation

◆ _mesa_free_matrix_data()

void _mesa_free_matrix_data ( struct gl_context ctx)

Free the context matrix data.

Parameters
ctxGL context.

Frees each of the matrix stacks and the combined modelview-projection matrix.

Definition at line 674 of file matrix.c.

Referenced by _mesa_free_context_data().

675 {
679  /* combined Modelview*Projection matrix */
681 
682 }
struct gl_matrix_stack ModelviewMatrixStack
Definition: mtypes.h:1782
void _math_matrix_dtr(GLmatrix *m)
Definition: m_matrix.c:1500
static void free_matrix_stack(struct gl_matrix_stack *stack)
Definition: matrix.c:624
GLmatrix _ModelProjectMatrix
Definition: mtypes.h:1789
struct gl_matrix_stack TextureMatrixStack
Definition: mtypes.h:1784
struct gl_matrix_stack ProjectionMatrixStack
Definition: mtypes.h:1783

◆ _mesa_Frustum()

void GLAPIENTRY _mesa_Frustum ( GLdouble  left,
GLdouble  right,
GLdouble  bottom,
GLdouble  top,
GLdouble  nearval,
GLdouble  farval 
)

Apply a perspective projection matrix.

Parameters
leftleft clipping plane coordinate.
rightright clipping plane coordinate.
bottombottom clipping plane coordinate.
toptop clipping plane coordinate.
nearvaldistance to the near clipping plane.
farvaldistance to the far clipping plane.
See also
glFrustum().

Flushes vertices and validates parameters. Calls _math_matrix_frustum() with the top matrix of the current matrix stack and sets __struct gl_contextRec::NewState.

Definition at line 56 of file matrix.c.

59 {
62 
63  if (nearval <= 0.0 ||
64  farval <= 0.0 ||
65  nearval == farval ||
66  left == right ||
67  top == bottom)
68  {
69  _mesa_error( ctx, GL_INVALID_VALUE, "glFrustum" );
70  return;
71  }
72 
73  _math_matrix_frustum( ctx->CurrentStack->Top,
74  (GLfloat) left, (GLfloat) right,
75  (GLfloat) bottom, (GLfloat) top,
76  (GLfloat) nearval, (GLfloat) farval );
77  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
78 }
void _math_matrix_frustum(GLmatrix *mat, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval)
Definition: m_matrix.c:981
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
GLint GLint bottom
Definition: glext.h:7726
float GLfloat
Definition: gl.h:161
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define GL_INVALID_VALUE
Definition: gl.h:695
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832

◆ _mesa_init_matrix()

void _mesa_init_matrix ( struct gl_context ctx)

Initialize the context matrix data.

Parameters
ctxGL context.

Initializes each of the matrix stacks and the combined modelview-projection matrix.

Definition at line 650 of file matrix.c.

Referenced by init_attrib_groups().

651 {
652  /* Initialize matrix stacks */
659  ctx->CurrentStack = &ctx->ModelviewMatrixStack;
660 
661  /* Init combined Modelview*Projection matrix */
663 }
struct gl_matrix_stack * CurrentStack
Definition: mtypes.h:1785
#define MAX_TEXTURE_STACK_DEPTH
Definition: config.h:47
static void init_matrix_stack(struct gl_matrix_stack *stack, GLuint maxDepth, GLuint dirtyFlag)
Definition: matrix.c:598
struct gl_matrix_stack ModelviewMatrixStack
Definition: mtypes.h:1782
#define MAX_PROJECTION_STACK_DEPTH
Definition: config.h:44
#define _NEW_TEXTURE_MATRIX
Definition: mtypes.h:1589
#define _NEW_PROJECTION
Definition: mtypes.h:1588
GLmatrix _ModelProjectMatrix
Definition: mtypes.h:1789
#define _NEW_MODELVIEW
Definition: mtypes.h:1587
struct gl_matrix_stack TextureMatrixStack
Definition: mtypes.h:1784
struct gl_matrix_stack ProjectionMatrixStack
Definition: mtypes.h:1783
#define MAX_MODELVIEW_STACK_DEPTH
Definition: config.h:41
void _math_matrix_ctr(GLmatrix *m)
Definition: m_matrix.c:1482

◆ _mesa_init_transform()

void _mesa_init_transform ( struct gl_context ctx)

Initialize the context transform attribute group.

Parameters
ctxGL context.
Todo:
Move this to a new file with other 'transform' routines.

Definition at line 692 of file matrix.c.

Referenced by init_attrib_groups().

693 {
694  GLint i;
695 
696  /* Transformation group */
697  ctx->Transform.MatrixMode = GL_MODELVIEW;
698  ctx->Transform.Normalize = GL_FALSE;
699  ctx->Transform.RescaleNormals = GL_FALSE;
700  ctx->Transform.RasterPositionUnclipped = GL_FALSE;
701  for (i=0;i<ctx->Const.MaxClipPlanes;i++) {
702  ASSIGN_4V( ctx->Transform.EyeUserPlane[i], 0.0, 0.0, 0.0, 0.0 );
703  }
704  ctx->Transform.ClipPlanesEnabled = 0;
705 
706  ASSIGN_4V( ctx->Transform.CullObjPos, 0.0, 0.0, 1.0, 0.0 );
707  ASSIGN_4V( ctx->Transform.CullEyePos, 0.0, 0.0, 1.0, 0.0 );
708 }
#define GL_FALSE
Definition: gl.h:173
GLenum GLclampf GLint i
Definition: glfuncs.h:14
struct gl_constants Const
Definition: mtypes.h:1778
#define ASSIGN_4V(V, V0, V1, V2, V3)
Definition: macros.h:345
struct gl_transform_attrib Transform
Definition: mtypes.h:1834
#define GL_MODELVIEW
Definition: gl.h:245
const GLint const GLsizei GLint
Definition: dispatch.h:5271

◆ _mesa_LoadIdentity()

void GLAPIENTRY _mesa_LoadIdentity ( void  )

Replace the current matrix with the identity matrix.

See also
glLoadIdentity().

Flushes the vertices and calls _math_matrix_set_identity() with the top-most matrix in the current stack. Marks __struct gl_contextRec::NewState with the stack dirty flag.

Definition at line 251 of file matrix.c.

Referenced by _mesa_meta_begin().

252 {
253  GET_CURRENT_CONTEXT(ctx);
255 
257  _mesa_debug(ctx, "glLoadIdentity()\n");
258 
259  _math_matrix_set_identity( ctx->CurrentStack->Top );
260  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
261 }
void _math_matrix_set_identity(GLmatrix *mat)
Definition: m_matrix.c:1139
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
int MESA_VERBOSE
Definition: context.c:86
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267

◆ _mesa_LoadMatrixd()

void GLAPIENTRY _mesa_LoadMatrixd ( const GLdouble m)

Referenced by _mesa_Translatef().

◆ _mesa_LoadMatrixf()

void GLAPIENTRY _mesa_LoadMatrixf ( const GLfloat m)

Replace the current matrix with a given matrix.

Parameters
mmatrix.
See also
glLoadMatrixf().

Flushes the vertices and calls _math_matrix_loadf() with the top-most matrix in the current stack and the given matrix. Marks __struct gl_contextRec::NewState with the dirty stack flag.

Definition at line 276 of file matrix.c.

Referenced by _mesa_meta_end(), and _mesa_Translatef().

277 {
278  GET_CURRENT_CONTEXT(ctx);
279  if (!m) return;
281  _mesa_debug(ctx,
282  "glLoadMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
283  m[0], m[4], m[8], m[12],
284  m[1], m[5], m[9], m[13],
285  m[2], m[6], m[10], m[14],
286  m[3], m[7], m[11], m[15]);
287 
289  _math_matrix_loadf( ctx->CurrentStack->Top, m );
290  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
291 }
void _math_matrix_loadf(GLmatrix *mat, const GLfloat *m)
Definition: m_matrix.c:1468
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
int MESA_VERBOSE
Definition: context.c:86
const GLfloat * m
Definition: glext.h:10848
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267

◆ _mesa_LoadTransposeMatrixdARB()

void GLAPIENTRY _mesa_LoadTransposeMatrixdARB ( const GLdouble m)

Referenced by _mesa_Translatef().

◆ _mesa_LoadTransposeMatrixfARB()

void GLAPIENTRY _mesa_LoadTransposeMatrixfARB ( const GLfloat m)

Referenced by _mesa_Translatef().

◆ _mesa_MatrixMode()

void GLAPIENTRY _mesa_MatrixMode ( GLenum  mode)

Set the current matrix stack.

Parameters
modematrix stack.
See also
glMatrixMode().

Flushes the vertices, validates the parameter and updates __struct gl_contextRec::CurrentStack and gl_transform_attrib::MatrixMode with the specified matrix stack.

Definition at line 137 of file matrix.c.

Referenced by _mesa_meta_begin(), and _mesa_meta_end().

138 {
139  GET_CURRENT_CONTEXT(ctx);
141 
142  if (ctx->Transform.MatrixMode == mode && mode != GL_TEXTURE)
143  return;
145 
146  switch (mode) {
147  case GL_MODELVIEW:
148  ctx->CurrentStack = &ctx->ModelviewMatrixStack;
149  break;
150  case GL_PROJECTION:
151  ctx->CurrentStack = &ctx->ProjectionMatrixStack;
152  break;
153  case GL_TEXTURE:
154  ctx->CurrentStack = &ctx->TextureMatrixStack;
155  break;
156  default:
157  _mesa_error( ctx, GL_INVALID_ENUM, "glMatrixMode(mode)" );
158  return;
159  }
160 
161  ctx->Transform.MatrixMode = mode;
162 }
#define FLUSH_VERTICES(ctx, newstate)
Definition: context.h:204
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
#define GL_PROJECTION
Definition: gl.h:246
GLenum mode
Definition: glext.h:6217
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_MODELVIEW
Definition: gl.h:245
#define _NEW_TRANSFORM
Definition: mtypes.h:1604
#define GL_TEXTURE
Definition: gl.h:247
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832

◆ _mesa_MultMatrixd()

void GLAPIENTRY _mesa_MultMatrixd ( const GLdouble m)

Referenced by _mesa_Translatef().

◆ _mesa_MultMatrixf()

void GLAPIENTRY _mesa_MultMatrixf ( const GLfloat m)

Multiply the current matrix with a given matrix.

Parameters
mmatrix.
See also
glMultMatrixf().

Flushes the vertices and calls _math_matrix_mul_floats() with the top-most matrix in the current stack and the given matrix. Marks __struct gl_contextRec::NewState with the dirty stack flag.

Definition at line 306 of file matrix.c.

Referenced by _mesa_Translatef().

307 {
308  GET_CURRENT_CONTEXT(ctx);
309  if (!m) return;
311  _mesa_debug(ctx,
312  "glMultMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
313  m[0], m[4], m[8], m[12],
314  m[1], m[5], m[9], m[13],
315  m[2], m[6], m[10], m[14],
316  m[3], m[7], m[11], m[15]);
318  _math_matrix_mul_floats( ctx->CurrentStack->Top, m );
319  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
320 }
void _math_matrix_mul_floats(GLmatrix *dest, const GLfloat *m)
Definition: m_matrix.c:257
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
int MESA_VERBOSE
Definition: context.c:86
const GLfloat * m
Definition: glext.h:10848
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267

◆ _mesa_MultTransposeMatrixdARB()

void GLAPIENTRY _mesa_MultTransposeMatrixdARB ( const GLdouble m)

Referenced by _mesa_Translatef().

◆ _mesa_MultTransposeMatrixfARB()

void GLAPIENTRY _mesa_MultTransposeMatrixfARB ( const GLfloat m)

Referenced by _mesa_Translatef().

◆ _mesa_Ortho()

void GLAPIENTRY _mesa_Ortho ( GLdouble  left,
GLdouble  right,
GLdouble  bottom,
GLdouble  top,
GLdouble  nearval,
GLdouble  farval 
)

Apply an orthographic projection matrix.

Parameters
leftleft clipping plane coordinate.
rightright clipping plane coordinate.
bottombottom clipping plane coordinate.
toptop clipping plane coordinate.
nearvaldistance to the near clipping plane.
farvaldistance to the far clipping plane.
See also
glOrtho().

Flushes vertices and validates parameters. Calls _math_matrix_ortho() with the top matrix of the current matrix stack and sets __struct gl_contextRec::NewState.

Definition at line 98 of file matrix.c.

Referenced by _mesa_meta_begin().

101 {
102  GET_CURRENT_CONTEXT(ctx);
104 
106  _mesa_debug(ctx, "glOrtho(%f, %f, %f, %f, %f, %f)\n",
107  left, right, bottom, top, nearval, farval);
108 
109  if (left == right ||
110  bottom == top ||
111  nearval == farval)
112  {
113  _mesa_error( ctx, GL_INVALID_VALUE, "glOrtho" );
114  return;
115  }
116 
117  _math_matrix_ortho( ctx->CurrentStack->Top,
118  (GLfloat) left, (GLfloat) right,
119  (GLfloat) bottom, (GLfloat) top,
120  (GLfloat) nearval, (GLfloat) farval );
121  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
122 }
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
GLint GLint bottom
Definition: glext.h:7726
float GLfloat
Definition: gl.h:161
int MESA_VERBOSE
Definition: context.c:86
GLint left
Definition: glext.h:7726
GLdouble GLdouble right
Definition: glext.h:10859
#define GL_INVALID_VALUE
Definition: gl.h:695
void _math_matrix_ortho(GLmatrix *mat, GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval)
Definition: m_matrix.c:1021
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832

◆ _mesa_PopMatrix()

void GLAPIENTRY _mesa_PopMatrix ( void  )

Pop the current matrix stack.

See also
glPopMatrix().

Flushes the vertices, verifies the current matrix stack is not empty, and moves the stack head down. Marks __struct gl_contextRec::NewState with the dirty stack flag.

Definition at line 214 of file matrix.c.

215 {
216  GET_CURRENT_CONTEXT(ctx);
217  struct gl_matrix_stack *stack = ctx->CurrentStack;
219 
221  _mesa_debug(ctx, "glPopMatrix %s\n",
222  _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
223 
224  if (stack->Depth == 0) {
225  if (ctx->Transform.MatrixMode == GL_TEXTURE) {
227  "glPopMatrix(mode=GL_TEXTURE)");
228  }
229  else {
230  _mesa_error(ctx, GL_STACK_UNDERFLOW, "glPopMatrix(mode=%s)",
231  _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
232  }
233  return;
234  }
235  stack->Depth--;
236  stack->Top = &(stack->Stack[stack->Depth]);
237  ctx->NewState |= stack->DirtyFlag;
238 }
GLuint DirtyFlag
Definition: mtypes.h:1563
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
GLmatrix * Top
Definition: mtypes.h:1559
Definition: _stack.h:47
GLuint Depth
Definition: mtypes.h:1561
GLmatrix * Stack
Definition: mtypes.h:1560
int MESA_VERBOSE
Definition: context.c:86
const char * _mesa_lookup_enum_by_nr(int nr)
Definition: enums.c:6332
#define GL_TEXTURE
Definition: gl.h:247
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267
#define GL_STACK_UNDERFLOW
Definition: gl.h:698
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832

◆ _mesa_PushMatrix()

void GLAPIENTRY _mesa_PushMatrix ( void  )

Push the current matrix stack.

See also
glPushMatrix().

Verifies the current matrix stack is not full, and duplicates the top-most matrix in the stack. Marks __struct gl_contextRec::NewState with the stack dirty flag.

Definition at line 175 of file matrix.c.

176 {
177  GET_CURRENT_CONTEXT(ctx);
178  struct gl_matrix_stack *stack = ctx->CurrentStack;
180 
182  _mesa_debug(ctx, "glPushMatrix %s\n",
183  _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
184 
185  if (stack->Depth + 1 >= stack->MaxDepth) {
186  if (ctx->Transform.MatrixMode == GL_TEXTURE) {
188  "glPushMatrix(mode=GL_TEXTURE)");
189  }
190  else {
191  _mesa_error(ctx, GL_STACK_OVERFLOW, "glPushMatrix(mode=%s)",
192  _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode));
193  }
194  return;
195  }
196  _math_matrix_copy( &stack->Stack[stack->Depth + 1],
197  &stack->Stack[stack->Depth] );
198  stack->Depth++;
199  stack->Top = &(stack->Stack[stack->Depth]);
200  ctx->NewState |= stack->DirtyFlag;
201 }
GLuint DirtyFlag
Definition: mtypes.h:1563
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
GLmatrix * Top
Definition: mtypes.h:1559
Definition: _stack.h:47
GLuint Depth
Definition: mtypes.h:1561
GLmatrix * Stack
Definition: mtypes.h:1560
GLuint MaxDepth
Definition: mtypes.h:1562
int MESA_VERBOSE
Definition: context.c:86
const char * _mesa_lookup_enum_by_nr(int nr)
Definition: enums.c:6332
#define GL_STACK_OVERFLOW
Definition: gl.h:697
#define GL_TEXTURE
Definition: gl.h:247
void _math_matrix_copy(GLmatrix *to, const GLmatrix *from)
Definition: m_matrix.c:1442
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832

◆ _mesa_Rotated()

void GLAPIENTRY _mesa_Rotated ( GLdouble  angle,
GLdouble  x,
GLdouble  y,
GLdouble  z 
)

Referenced by _mesa_Translatef().

◆ _mesa_Rotatef()

void GLAPIENTRY _mesa_Rotatef ( GLfloat  angle,
GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Multiply the current matrix with a rotation matrix.

Parameters
angleangle of rotation, in degrees.
xrotation vector x coordinate.
yrotation vector y coordinate.
zrotation vector z coordinate.
See also
glRotatef().

Flushes the vertices and calls _math_matrix_rotate() with the top-most matrix in the current stack and the given parameters. Marks __struct gl_contextRec::NewState with the dirty stack flag.

Definition at line 338 of file matrix.c.

Referenced by _mesa_Translatef().

339 {
340  GET_CURRENT_CONTEXT(ctx);
342  if (angle != 0.0F) {
343  _math_matrix_rotate( ctx->CurrentStack->Top, angle, x, y, z);
344  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
345  }
346 }
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
GLfloat angle
Definition: glext.h:10853
INT INT y
Definition: msvc.h:62
GLdouble GLdouble z
Definition: glext.h:5874
void _math_matrix_rotate(GLmatrix *mat, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
Definition: m_matrix.c:797
INT x
Definition: msvc.h:62
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267
#define F(x, y, z)
Definition: md5.c:51

◆ _mesa_Scaled()

void GLAPIENTRY _mesa_Scaled ( GLdouble  x,
GLdouble  y,
GLdouble  z 
)

Referenced by _mesa_Translatef().

◆ _mesa_Scalef()

void GLAPIENTRY _mesa_Scalef ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Multiply the current matrix with a general scaling matrix.

Parameters
xx axis scale factor.
yy axis scale factor.
zz axis scale factor.
See also
glScalef().

Flushes the vertices and calls _math_matrix_scale() with the top-most matrix in the current stack and the given parameters. Marks __struct gl_contextRec::NewState with the dirty stack flag.

Definition at line 363 of file matrix.c.

Referenced by _mesa_Translatef().

364 {
365  GET_CURRENT_CONTEXT(ctx);
367  _math_matrix_scale( ctx->CurrentStack->Top, x, y, z);
368  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
369 }
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
INT INT y
Definition: msvc.h:62
GLdouble GLdouble z
Definition: glext.h:5874
INT x
Definition: msvc.h:62
void _math_matrix_scale(GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z)
Definition: m_matrix.c:1067
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267

◆ _mesa_Translated()

void GLAPIENTRY _mesa_Translated ( GLdouble  x,
GLdouble  y,
GLdouble  z 
)

Referenced by _mesa_Translatef().

◆ _mesa_Translatef()

void GLAPIENTRY _mesa_Translatef ( GLfloat  x,
GLfloat  y,
GLfloat  z 
)

Multiply the current matrix with a translation matrix.

Parameters
xtranslation vector x coordinate.
ytranslation vector y coordinate.
ztranslation vector z coordinate.
See also
glTranslatef().

Flushes the vertices and calls _math_matrix_translate() with the top-most matrix in the current stack and the given parameters. Marks __struct gl_contextRec::NewState with the dirty stack flag.

Definition at line 386 of file matrix.c.

Referenced by _mesa_Translatef().

387 {
388  GET_CURRENT_CONTEXT(ctx);
390  _math_matrix_translate( ctx->CurrentStack->Top, x, y, z);
391  ctx->NewState |= ctx->CurrentStack->DirtyFlag;
392 }
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:69
INT INT y
Definition: msvc.h:62
GLdouble GLdouble z
Definition: glext.h:5874
INT x
Definition: msvc.h:62
void _math_matrix_translate(GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z)
Definition: m_matrix.c:1097
#define ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx)
Definition: context.h:267

◆ _mesa_update_modelview_project()

void _mesa_update_modelview_project ( struct gl_context ctx,
GLuint  new_state 
)

Updates the combined modelview-projection matrix.

Parameters
ctxGL context.
new_statenew state bit mask.

If there is a new model view matrix then analyzes it. If there is a new projection matrix, updates it. Finally calls calculate_model_project_matrix() to recalculate the modelview-projection matrix.

Definition at line 556 of file matrix.c.

Referenced by _mesa_update_state_locked().

557 {
558  if (new_state & _NEW_MODELVIEW) {
560 
561  /* Bring cull position up to date.
562  */
563  TRANSFORM_POINT3( ctx->Transform.CullObjPos,
564  ctx->ModelviewMatrixStack.Top->inv,
565  ctx->Transform.CullEyePos );
566  }
567 
568 
569  if (new_state & _NEW_PROJECTION)
570  update_projection( ctx );
571 
572  /* Keep ModelviewProject up to date always to allow tnl
573  * implementations that go model->clip even when eye is required.
574  */
576 }
struct gl_matrix_stack ModelviewMatrixStack
Definition: mtypes.h:1782
static void update_projection(struct gl_context *ctx)
Definition: matrix.c:503
static void calculate_model_project_matrix(struct gl_context *ctx)
Definition: matrix.c:535
struct gl_transform_attrib Transform
Definition: mtypes.h:1834
#define _NEW_PROJECTION
Definition: mtypes.h:1588
#define _NEW_MODELVIEW
Definition: mtypes.h:1587
#define TRANSFORM_POINT3(Q, M, P)
Definition: m_matrix.h:181
void _math_matrix_analyse(GLmatrix *mat)
Definition: m_matrix.c:1368