GlFrontFace: Difference between revisions

From QB64 Phoenix Edition Wiki
Jump to navigation Jump to search
(Created page with "'''_glFrontFace:''' define front- and back-facing polygons {{PageSyntax}} SUB _glFrontFace (BYVAL mode AS _UNSIGNED LONG) void '''_glFrontFace'''(GLenum {{Parameter|mode}}); ; mode : Specifies the orientation of front-facing polygons. {{KW|_GL_CW}} and {{KW|_GL_CCW}} are accepted. The initial value is {{KW|_GL_CCW}}. {{PageDescription}} In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible...")
 
No edit summary
Line 1: Line 1:
'''_glFrontFace:''' define front- and back-facing polygons
{{DISPLAYTITLE:_glFrontFace}}
The '''_glFrontFace''' statement defines front-facing and back-facing polygons.




{{PageSyntax}}
{{PageSyntax}}
: '''_glFrontFace''' GLenum {{Parameter|mode}}


  SUB _glFrontFace (BYVAL mode AS _UNSIGNED LONG)
  void '''_glFrontFace'''(GLenum {{Parameter|mode}});


 
{{PageParameters}}
; mode
* OpenGL is using its own set of variable types to describe its command parameters.
: Specifies the orientation of front-facing polygons. {{KW|_GL_CW}} and {{KW|_GL_CCW}} are accepted. The initial value is {{KW|_GL_CCW}}.
* Use the following table to find the respective QB64 [[Variable Types]].
{{OpenGLTypesPlugin}}




{{PageDescription}}
{{PageDescription}}
 
* OpenGL's documentation is available in several places, so we won't reproduce it here for another time.
In a scene composed entirely of opaque closed surfaces, back-facing polygons are never visible. Eliminating these invisible polygons has the obvious benefit of speeding up the rendering of the image. To enable and disable elimination of back-facing polygons, call {{KW|_glEnable}} and {{KW|_glDisable}} with argument {{KW|_GL_CULL_FACE}}.
* The full description for this command can be found at [https://docs.microsoft.com/en-us/windows/win32/opengl/glfrontface Microsoft Docs] and is also valid for QB64 usage.
 
The projection of a polygon to window coordinates is said to have clockwise winding if an imaginary object following the path from its first vertex, its second vertex, and so on, to its last vertex, and finally back to its first vertex, moves in a clockwise direction about the interior of the polygon. The polygon's winding is said to be counterclockwise if the imaginary object following the same path moves in a counterclockwise direction about the interior of the polygon. '''_glFrontFace''' specifies whether polygons with clockwise winding in window coordinates, or counterclockwise winding in window coordinates, are taken to be front-facing. Passing {{KW|_GL_CCW}} to {{Parameter|mode}} selects counterclockwise polygons as front-facing; {{KW|_GL_CW}} selects clockwise polygons as front-facing. By default, counterclockwise polygons are taken to be front-facing.
 
 
{{PageErrors}}
 
{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|mode}} is not an accepted value.
 
 
{{PageUseWith}}
 
{{KW|_glGet}} with argument {{KW|_GL_FRONT_FACE}}




{{PageSeeAlso}}
{{PageSeeAlso}}
 
* [[_GL|SUB _GL]]
[[_GL|SUB _GL]]
{{KW|_glCullFace}}




{{PageCopyright}}
{{PageNavigation}}


Copyright 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see [http://oss.sgi.com/projects/FreeB/ http://oss.sgi.com/projects/FreeB/].
[[Category:Final]]

Revision as of 23:14, 16 July 2022

The _glFrontFace statement defines front-facing and back-facing polygons.


Syntax

_glFrontFace GLenum mode


Parameters

  • OpenGL is using its own set of variable types to describe its command parameters.
  • Use the following table to find the respective QB64 Variable Types.
   Table 2: Relations between the OpenGL variable types vs. C/C++ and QB64.
 ┌──────────────┬────────────────┬──────────────────────────────────────────┐
 │    OpenGLC/C++QB64                                 │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLenum       │ unsigned int   │ _UNSIGNED LONG                           │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLboolean    │ unsigned char  │ _UNSIGNED _BYTE                          │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLbitfield   │ unsigned int   │ _UNSIGNED LONG                           │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLbyte       │ signed char    │ _BYTE                                    │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLshort      │ short          │ INTEGER                                  │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLint        │ int            │ LONG                                     │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLsizei      │ int            │ LONG                                     │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLubyte      │ unsigned char  │ _UNSIGNED _BYTE                          │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLushort     │ unsigned short │ _UNSIGNED INTEGER                        │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLuint       │ unsigned int   │ _UNSIGNED LONG                           │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLfloat      │ float          │ SINGLE                                   │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLclampf     │ float          │ SINGLE                                   │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLdouble     │ double         │ DOUBLE                                   │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLclampd     │ double         │ DOUBLE                                   │
 ├──────────────┼────────────────┼──────────────────────────────────────────┤
 │ GLvoid   (1) │ void           │ _OFFSET(any fixed lenght string or _BYTE │
 │              │                │         array element)                   │
 └──────────────┴────────────────┴──────────────────────────────────────────┘
 Note: If a parameter has an asterisk (*) in front, then it's a pointer to
       the designated OpenGL variable type, rather than a value of that type.
       Those must be passed using the _OFFSET(...) notation.

 E.g.  GLuint *anyParam is actually the offset of a _UNSIGNED LONG (~&)
       variable or array, which must be passed as _OFFSET(anyVar~&) or
       _OFFSET(anyArr~&()) respectively.

  (1)  This type is regularly only used for pointers (with asterisk (*)) to
       any byte sized memory data, hence _BYTE or fixed length strings.


Description

  • OpenGL's documentation is available in several places, so we won't reproduce it here for another time.
  • The full description for this command can be found at Microsoft Docs and is also valid for QB64 usage.


See also



Navigation:
Main Page with Articles and Tutorials
Keyword Reference - Alphabetical
Keyword Reference - By usage
Report a broken link