ReactOS 0.4.15-dev-7659-ga55345b
lines.h File Reference
#include "types.h"
Include dependency graph for lines.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void gl_LineWidth (GLcontext *ctx, GLfloat width)
 
void gl_LineStipple (GLcontext *ctx, GLint factor, GLushort pattern)
 
void gl_set_line_function (GLcontext *ctx)
 

Function Documentation

◆ gl_LineStipple()

void gl_LineStipple ( GLcontext ctx,
GLint  factor,
GLushort  pattern 
)

Definition at line 120 of file lines.c.

121{
122 if (INSIDE_BEGIN_END(ctx)) {
123 gl_error( ctx, GL_INVALID_OPERATION, "glLineStipple" );
124 return;
125 }
126 ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
127 ctx->Line.StipplePattern = pattern;
128 ctx->NewState |= NEW_RASTER_OPS;
129}
void gl_error(GLcontext *ctx, GLenum error, const char *s)
Definition: context.c:1421
#define NEW_RASTER_OPS
Definition: types.h:1233
#define GL_INVALID_OPERATION
Definition: gl.h:696
GLubyte * pattern
Definition: glext.h:7787
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint factor
Definition: glfuncs.h:178
#define INSIDE_BEGIN_END(CTX)
Definition: macros.h:135
#define CLAMP(f, min, max)
Definition: tif_color.c:177

Referenced by execute_list(), and init_exec_pointers().

◆ gl_LineWidth()

void gl_LineWidth ( GLcontext ctx,
GLfloat  width 
)

Definition at line 104 of file lines.c.

105{
106 if (width<=0.0) {
107 gl_error( ctx, GL_INVALID_VALUE, "glLineWidth" );
108 return;
109 }
110 if (INSIDE_BEGIN_END(ctx)) {
111 gl_error( ctx, GL_INVALID_OPERATION, "glLineWidth" );
112 return;
113 }
114 ctx->Line.Width = width;
115 ctx->NewState |= NEW_RASTER_OPS;
116}
#define GL_INVALID_VALUE
Definition: gl.h:695
GLint GLint GLsizei width
Definition: gl.h:1546

Referenced by execute_list(), and init_exec_pointers().

◆ gl_set_line_function()

void gl_set_line_function ( GLcontext ctx)

Definition at line 898 of file lines.c.

899{
900 GLboolean rgbmode = ctx->Visual->RGBAflag;
901 /* TODO: antialiased lines */
902
903 if (ctx->RenderMode==GL_RENDER) {
904 if (ctx->NoRaster) {
905 ctx->Driver.LineFunc = null_line;
906 return;
907 }
908 if (ctx->Driver.LineFunc) {
909 /* Device driver will draw lines. */
910 ctx->Driver.LineFunc = ctx->Driver.LineFunc;
911 }
912 else if (ctx->Texture.Enabled) {
913 if (ctx->Light.ShadeModel==GL_SMOOTH) {
914 ctx->Driver.LineFunc = smooth_textured_line;
915 }
916 else {
917 ctx->Driver.LineFunc = flat_textured_line;
918 }
919 }
920 else if (ctx->Line.Width!=1.0 || ctx->Line.StippleFlag
921 || ctx->Line.SmoothFlag || ctx->Texture.Enabled) {
922 if (ctx->Light.ShadeModel==GL_SMOOTH) {
923 if (rgbmode)
924 ctx->Driver.LineFunc = general_smooth_rgba_line;
925 else
926 ctx->Driver.LineFunc = general_smooth_ci_line;
927 }
928 else {
929 if (rgbmode)
930 ctx->Driver.LineFunc = general_flat_rgba_line;
931 else
932 ctx->Driver.LineFunc = general_flat_ci_line;
933 }
934 }
935 else {
936 if (ctx->Light.ShadeModel==GL_SMOOTH) {
937 /* Width==1, non-stippled, smooth-shaded */
938 if (ctx->Depth.Test
939 || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
940 if (rgbmode)
941 ctx->Driver.LineFunc = smooth_rgba_z_line;
942 else
943 ctx->Driver.LineFunc = smooth_ci_z_line;
944 }
945 else {
946 if (rgbmode)
947 ctx->Driver.LineFunc = smooth_rgba_line;
948 else
949 ctx->Driver.LineFunc = smooth_ci_line;
950 }
951 }
952 else {
953 /* Width==1, non-stippled, flat-shaded */
954 if (ctx->Depth.Test
955 || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
956 if (rgbmode)
957 ctx->Driver.LineFunc = flat_rgba_z_line;
958 else
959 ctx->Driver.LineFunc = flat_ci_z_line;
960 }
961 else {
962 if (rgbmode)
963 ctx->Driver.LineFunc = flat_rgba_line;
964 else
965 ctx->Driver.LineFunc = flat_ci_line;
966 }
967 }
968 }
969 }
970 else if (ctx->RenderMode==GL_FEEDBACK) {
971 ctx->Driver.LineFunc = feedback_line;
972 }
973 else {
974 /* GL_SELECT mode */
975 ctx->Driver.LineFunc = select_line;
976 }
977}
static void flat_rgba_z_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:307
static void smooth_rgba_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:391
static void smooth_rgba_z_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:424
static void null_line(GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv)
Definition: lines.c:888
static void feedback_line(GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv)
Definition: lines.c:155
static void general_flat_rgba_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:690
static void flat_ci_z_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:253
static void general_smooth_rgba_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:600
static void general_flat_ci_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:537
static void general_smooth_ci_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:468
static void smooth_textured_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pv)
Definition: lines.c:814
static void smooth_ci_z_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:362
static void flat_rgba_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:281
static void flat_ci_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:228
static void select_line(GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv)
Definition: lines.c:212
static void flat_textured_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pv)
Definition: lines.c:755
static void smooth_ci_line(GLcontext *ctx, GLuint vert0, GLuint vert1, GLuint pvert)
Definition: lines.c:336
#define GL_RENDER
Definition: gl.h:388
#define GL_NICEST
Definition: gl.h:585
#define GL_SMOOTH
Definition: gl.h:339
#define GL_FEEDBACK
Definition: gl.h:387
unsigned char GLboolean
Definition: gl.h:151

Referenced by gl_update_state().