Difference between pages "GlGetTexParameter" and "GlHint"

From QB64 Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Galleon
(Created page with ''''_glGetTexParameter:''' return texture parameter values {{PageSyntax}} SUB _glGetTexParameterfv (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, params AS S…')
 
imported>Galleon
(Created page with ''''_glHint:''' specify implementation-specific hints {{PageSyntax}} SUB _glHint (BYVAL target AS _UNSIGNED LONG, BYVAL mode AS _UNSIGNED LONG) void '''_glHint'''(GLenum {{…')
 
Line 1: Line 1:
'''_glGetTexParameter:''' return texture parameter values
+
'''_glHint:''' specify implementation-specific hints
  
  
 
{{PageSyntax}}
 
{{PageSyntax}}
  
   SUB _glGetTexParameterfv (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, params AS SINGLE)
+
   SUB _glHint (BYVAL target AS _UNSIGNED LONG, BYVAL mode AS _UNSIGNED LONG)
   void '''_glGetTexParameterfv'''(GLenum {{Parameter|target}}, GLenum {{Parameter|pname}}, GLfloat * {{Parameter|params}});
+
   void '''_glHint'''(GLenum {{Parameter|target}}, GLenum {{Parameter|mode}});
  
  SUB _glGetTexParameteriv (BYVAL target AS _UNSIGNED LONG, BYVAL pname AS _UNSIGNED LONG, params AS LONG)
 
  void '''_glGetTexParameteriv'''(GLenum {{Parameter|target}}, GLenum {{Parameter|pname}}, GLint * {{Parameter|params}});
 
 
  void '''_glGetTexParameterIiv'''(GLenum {{Parameter|target}}, GLenum {{Parameter|pname}}, GLint * {{Parameter|params}});
 
  void '''_glGetTexParameterIuiv'''(GLenum {{Parameter|target}}, GLenum {{Parameter|pname}}, GLuint * {{Parameter|params}});
 
  
 
; target
 
; target
: Specifies the symbolic name of the target texture. {{KW|_GL_TEXTURE_1D}}, {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_2D_ARRAY}}, {{KW|_GL_TEXTURE_3D}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_CUBE_MAP}}, and {{KW|_GL_TEXTURE_CUBE_MAP_ARRAY}} are accepted.
+
: Specifies a symbolic constant indicating the behavior to be controlled. {{KW|_GL_LINE_SMOOTH_HINT}}, {{KW|_GL_POLYGON_SMOOTH_HINT}}, {{KW|_GL_TEXTURE_COMPRESSION_HINT}}, and {{KW|_GL_FRAGMENT_SHADER_DERIVATIVE_HINT}} are accepted.
; pname
+
; mode
: Specifies the symbolic name of a texture parameter. {{KW|_GL_DEPTH_STENCIL_TEXTURE_MODE}}, {{KW|_GL_TEXTURE_BASE_LEVEL}}, {{KW|_GL_TEXTURE_BORDER_COLOR}}, {{KW|_GL_TEXTURE_COMPARE_MODE}}, {{KW|_GL_TEXTURE_COMPARE_FUNC}}, {{KW|_GL_TEXTURE_IMMUTABLE_FORMAT}}, {{KW|_GL_TEXTURE_IMMUTABLE_LEVELS}}, {{KW|_GL_TEXTURE_LOD_BIAS}}, {{KW|_GL_TEXTURE_MAG_FILTER}}, {{KW|_GL_TEXTURE_MAX_LEVEL}}, {{KW|_GL_TEXTURE_MAX_LOD}}, {{KW|_GL_TEXTURE_MIN_FILTER}}, {{KW|_GL_TEXTURE_MIN_LOD}}, {{KW|_GL_TEXTURE_SWIZZLE_R}}, {{KW|_GL_TEXTURE_SWIZZLE_G}}, {{KW|_GL_TEXTURE_SWIZZLE_B}}, {{KW|_GL_TEXTURE_SWIZZLE_A}}, {{KW|_GL_TEXTURE_SWIZZLE_RGBA}}, {{KW|_GL_TEXTURE_VIEW_MIN_LAYER}}, {{KW|_GL_TEXTURE_VIEW_MIN_LEVEL}}, {{KW|_GL_TEXTURE_VIEW_NUM_LAYERS}}, {{KW|_GL_TEXTURE_VIEW_NUM_LEVELS}}, {{KW|_GL_TEXTURE_WRAP_S}}, {{KW|_GL_TEXTURE_WRAP_T}}, and {{KW|_GL_TEXTURE_WRAP_R}} are accepted.
+
: Specifies a symbolic constant indicating the desired behavior. {{KW|_GL_FASTEST}}, {{KW|_GL_NICEST}}, and {{KW|_GL_DONT_CARE}} are accepted.
; params
 
: Returns the texture parameters.
 
  
  
 
{{PageDescription}}
 
{{PageDescription}}
  
'''_glGetTexParameter''' returns in {{Parameter|params}} the value or values of the texture parameter specified as {{Parameter|pname}}. {{Parameter|target}} defines the target texture. {{KW|_GL_TEXTURE_1D}}, {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_3D}}, {{KW|_GL_TEXTURE_1D_ARRAY}}, {{KW|_GL_TEXTURE_2D_ARRAY}}, {{KW|_GL_TEXTURE_RECTANGLE}}, {{KW|_GL_TEXTURE_CUBE_MAP}}, {{KW|_GL_TEXTURE_CUBE_MAP_ARRAY}} specify one-, two-, or three-dimensional, one-dimensional array, two-dimensional array, rectangle, cube-mapped or cube-mapped array texturing, respectively. {{Parameter|pname}} accepts the same symbols as {{KW|_glTexParameter}}, with the same interpretations:
+
Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. {{Parameter|target}} is a symbolic constant indicating the behavior to be controlled, and {{Parameter|mode}} is another symbolic constant indicating the desired behavior. The initial value for each {{Parameter|target}} is {{KW|_GL_DONT_CARE}}. {{Parameter|mode}} can be one of the following:
  
; {{KW|_GL_DEPTH_STENCIL_TEXTURE_MODE}}
+
; {{KW|_GL_FASTEST}}
: Returns the single-value depth stencil texture mode, a symbolic constant. The initial value is {{KW|_GL_DEPTH_COMPONENT}}.
+
:  
; {{KW|_GL_TEXTURE_MAG_FILTER}}
+
The most efficient option should be chosen.
: Returns the single-valued texture magnification filter, a symbolic constant. The initial value is {{KW|_GL_LINEAR}}.
+
; {{KW|_GL_NICEST}}
; {{KW|_GL_TEXTURE_MIN_FILTER}}
+
:  
: Returns the single-valued texture minification filter, a symbolic constant. The initial value is {{KW|_GL_NEAREST_MIPMAP_LINEAR}}.
+
The most correct, or highest quality, option should be chosen.
; {{KW|_GL_TEXTURE_MIN_LOD}}
+
; {{KW|_GL_DONT_CARE}}
; {{KW|_GL_TEXTURE_MAX_LOD}}
+
:  
: Returns the single-valued texture maximum level-of-detail value. The initial value is 1000.
+
No preference.
; {{KW|_GL_TEXTURE_BASE_LEVEL}}
+
Though the implementation aspects that can be hinted are well defined, the interpretation of the hints depends on the implementation. The hint aspects that can be specified with {{Parameter|target}}, along with suggested semantics, are as follows:
: Returns the single-valued base texture mipmap level. The initial value is 0.
 
; {{KW|_GL_TEXTURE_MAX_LEVEL}}
 
: Returns the single-valued maximum texture mipmap array level. The initial value is 1000.
 
; {{KW|_GL_TEXTURE_SWIZZLE_R}}
 
: Returns the red component swizzle. The initial value is {{KW|_GL_RED}}.
 
; {{KW|_GL_TEXTURE_SWIZZLE_G}}
 
: Returns the green component swizzle. The initial value is {{KW|_GL_GREEN}}.
 
; {{KW|_GL_TEXTURE_SWIZZLE_B}}
 
: Returns the blue component swizzle. The initial value is {{KW|_GL_BLUE}}.
 
; {{KW|_GL_TEXTURE_SWIZZLE_A}}
 
: Returns the alpha component swizzle. The initial value is {{KW|_GL_ALPHA}}.
 
; {{KW|_GL_TEXTURE_SWIZZLE_RGBA}}
 
: Returns the component swizzle for all channels in a single query.
 
; {{KW|_GL_TEXTURE_WRAP_S}}
 
: Returns the single-valued wrapping function for texture coordinate ''s'', a symbolic constant. The initial value is {{KW|_GL_REPEAT}}.
 
; {{KW|_GL_TEXTURE_WRAP_T}}
 
: Returns the single-valued wrapping function for texture coordinate ''t'', a symbolic constant. The initial value is {{KW|_GL_REPEAT}}.
 
; {{KW|_GL_TEXTURE_WRAP_R}}
 
: Returns the single-valued wrapping function for texture coordinate ''r'', a symbolic constant. The initial value is {{KW|_GL_REPEAT}}.
 
; {{KW|_GL_TEXTURE_BORDER_COLOR}}
 
: Returns four integer or floating-point numbers that comprise the RGBA color of the texture border. Floating-point values are returned in the range [0, 1]. Integer values are returned as a linear mapping of the internal floating-point representation such that 1.0 maps to the most positive representable integer and -1.0 maps to the most negative representable integer. The initial value is (0, 0, 0, 0).
 
; {{KW|_GL_TEXTURE_COMPARE_MODE}}
 
: Returns a single-valued texture comparison mode, a symbolic constant. The initial value is {{KW|_GL_NONE}}. See {{KW|_glTexParameter}}.
 
; {{KW|_GL_TEXTURE_COMPARE_FUNC}}
 
: Returns a single-valued texture comparison function, a symbolic constant. The initial value is {{KW|_GL_LEQUAL}}. See {{KW|_glTexParameter}}.
 
; {{KW|_GL_TEXTURE_VIEW_MIN_LEVEL}}
 
: Returns a single-valued base level of a texture view relative to its parent. The initial value is 0. See {{KW|_glTextureView}}.
 
; {{KW|_GL_TEXTURE_VIEW_NUM_LEVELS}}
 
: Returns a single-valued number of levels of detail of a texture view. See {{KW|_glTextureView}}.
 
; {{KW|_GL_TEXTURE_VIEW_MIN_LAYER}}
 
: Returns a single-valued first level of a texture array view relative to its parent. See {{KW|_glTextureView}}.
 
; {{KW|_GL_TEXTURE_VIEW_NUM_LAYERS}}
 
: Returns a single-valued number of layers in a texture array view. See {{KW|_glTextureView}}.
 
; {{KW|_GL_TEXTURE_IMMUTABLE_LEVELS}}
 
: Returns a single-valued number of immutable texture levels in a texture view. See {{KW|_glTextureView}}.
 
In addition to the parameters that may be set with {{KW|_glTexParameter}}, '''_glGetTexParameter''' accepts the following read-only parameters:
 
  
; {{KW|_GL_TEXTURE_IMMUTABLE_FORMAT}}
+
; {{KW|_GL_FRAGMENT_SHADER_DERIVATIVE_HINT}}
: Returns non-zero if the texture has an immutable format. Textures become immutable if their storage is specified with {{KW|_glTexStorage1D}}, {{KW|_glTexStorage2D}} or {{KW|_glTexStorage3D}}. The initial value is {{KW|_GL_FALSE}}.
+
:  
 +
Indicates the accuracy of the derivative calculation for the GL shading language fragment processing built-in functions: {{KW|_dFdx}}, {{KW|_dFdy}}, and {{KW|_fwidth}}.
 +
; {{KW|_GL_LINE_SMOOTH_HINT}}
 +
:
 +
Indicates the sampling quality of antialiased lines. If a larger filter function is applied, hinting {{KW|_GL_NICEST}} can result in more pixel fragments being generated during rasterization.
 +
; {{KW|_GL_POLYGON_SMOOTH_HINT}}
 +
:
 +
Indicates the sampling quality of antialiased polygons. Hinting {{KW|_GL_NICEST}} can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.
 +
; {{KW|_GL_TEXTURE_COMPRESSION_HINT}}
 +
:
 +
Indicates the quality and performance of the compressing texture images. Hinting {{KW|_GL_FASTEST}} indicates that texture images should be compressed as quickly as possible, while {{KW|_GL_NICEST}} indicates that texture images should be compressed with as little image quality loss as possible. {{KW|_GL_NICEST}} should be selected if the texture is to be retrieved by {{KW|_glGetCompressedTexImage}} for reuse.
  
 
{{PageNotes}}
 
{{PageNotes}}
  
If an error is generated, no change is made to the contents of {{Parameter|params}}.
+
The interpretation of hints depends on the implementation. Some implementations ignore '''_glHint''' settings.
 
 
{{KW|_GL_DEPTH_STENCIL_TEXTURE_MODE}}, {{KW|_GL_TEXTURE_VIEW_MIN_LEVEL}}, {{KW|_GL_TEXTURE_VIEW_NUM_LEVELS}}, {{KW|_GL_TEXTURE_VIEW_MIN_LAYER}}, {{KW|_GL_TEXTURE_VIEW_NUM_LAYERS}} and {{KW|_GL_TEXTURE_IMMUTABLE_LEVELS}} are available only if the GL version is 4.3 or greater.
 
  
  
 
{{PageErrors}}
 
{{PageErrors}}
  
{{KW|_GL_INVALID_ENUM}} is generated if {{Parameter|target}} or {{Parameter|pname}} is not an accepted value.
+
{{KW|_GL_INVALID_ENUM}} is generated if either {{Parameter|target}} or {{Parameter|mode}} is not an accepted value.
 
 
 
 
{{PageSeeAlso}}
 
 
 
{{KW|_GL}}
 
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glGetTexLevelParameter}}, {{KW|_glTexParameter}}
 
  
  
 
{{PageCopyright}}
 
{{PageCopyright}}
  
Copyright 1991-2006 Silicon Graphics, Inc. Copyright 2010-2012 Khronos Group. 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/].
+
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/].

Latest revision as of 10:19, 8 January 2013

_glHint: specify implementation-specific hints


Syntax

 SUB _glHint (BYVAL target AS _UNSIGNED LONG, BYVAL mode AS _UNSIGNED LONG)
 void _glHint(GLenum target, GLenum mode);


target
Specifies a symbolic constant indicating the behavior to be controlled. _GL_LINE_SMOOTH_HINT, _GL_POLYGON_SMOOTH_HINT, _GL_TEXTURE_COMPRESSION_HINT, and _GL_FRAGMENT_SHADER_DERIVATIVE_HINT are accepted.
mode
Specifies a symbolic constant indicating the desired behavior. _GL_FASTEST, _GL_NICEST, and _GL_DONT_CARE are accepted.


Description

Certain aspects of GL behavior, when there is room for interpretation, can be controlled with hints. A hint is specified with two arguments. target is a symbolic constant indicating the behavior to be controlled, and mode is another symbolic constant indicating the desired behavior. The initial value for each target is _GL_DONT_CARE. mode can be one of the following:

_GL_FASTEST

The most efficient option should be chosen.

_GL_NICEST

The most correct, or highest quality, option should be chosen.

_GL_DONT_CARE

No preference. Though the implementation aspects that can be hinted are well defined, the interpretation of the hints depends on the implementation. The hint aspects that can be specified with target, along with suggested semantics, are as follows:

_GL_FRAGMENT_SHADER_DERIVATIVE_HINT

Indicates the accuracy of the derivative calculation for the GL shading language fragment processing built-in functions: _dFdx, _dFdy, and _fwidth.

_GL_LINE_SMOOTH_HINT

Indicates the sampling quality of antialiased lines. If a larger filter function is applied, hinting _GL_NICEST can result in more pixel fragments being generated during rasterization.

_GL_POLYGON_SMOOTH_HINT

Indicates the sampling quality of antialiased polygons. Hinting _GL_NICEST can result in more pixel fragments being generated during rasterization, if a larger filter function is applied.

_GL_TEXTURE_COMPRESSION_HINT

Indicates the quality and performance of the compressing texture images. Hinting _GL_FASTEST indicates that texture images should be compressed as quickly as possible, while _GL_NICEST indicates that texture images should be compressed with as little image quality loss as possible. _GL_NICEST should be selected if the texture is to be retrieved by _glGetCompressedTexImage for reuse.

Notes:

The interpretation of hints depends on the implementation. Some implementations ignore _glHint settings.


Errors

_GL_INVALID_ENUM is generated if either target or mode is not an accepted value.


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/.



Navigation:
Go to Keyword Reference - Alphabetical
Go to Keyword Reference - By usage
Go to Main WIKI Page

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/.