Difference between pages "GlGetTexLevelParameter" and "GlHint"

From QB64 Wiki
(Difference between pages)
Jump to navigation Jump to search
imported>Galleon
(Created page with ''''_glGetTexLevelParameter:''' return texture parameter values for a specific level of detail {{PageSyntax}} SUB _glGetTexLevelParameterfv (BYVAL target AS _UNSIGNED LONG, B…')
 
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:
'''_glGetTexLevelParameter:''' return texture parameter values for a specific level of detail
+
'''_glHint:''' specify implementation-specific hints
  
  
 
{{PageSyntax}}
 
{{PageSyntax}}
  
   SUB _glGetTexLevelParameterfv (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL pname AS _UNSIGNED LONG, params AS SINGLE)
+
   SUB _glHint (BYVAL target AS _UNSIGNED LONG, BYVAL mode AS _UNSIGNED LONG)
   void '''_glGetTexLevelParameterfv'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLenum {{Parameter|pname}}, GLfloat * {{Parameter|params}});
+
   void '''_glHint'''(GLenum {{Parameter|target}}, GLenum {{Parameter|mode}});
 
 
  SUB _glGetTexLevelParameteriv (BYVAL target AS _UNSIGNED LONG, BYVAL level AS LONG, BYVAL pname AS _UNSIGNED LONG, params AS LONG)
 
  void '''_glGetTexLevelParameteriv'''(GLenum {{Parameter|target}}, GLint {{Parameter|level}}, GLenum {{Parameter|pname}}, GLint * {{Parameter|params}});
 
  
  
 
; target
 
; target
: Specifies the symbolic name of the target texture, one of {{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_2D_MULTISAMPLE}}, {{KW|_GL_TEXTURE_2D_MULTISAMPLE_ARRAY}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, {{KW|_GL_PROXY_TEXTURE_1D}}, {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_3D}}, {{KW|_GL_PROXY_TEXTURE_1D_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_2D_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_RECTANGLE}}, {{KW|_GL_PROXY_TEXTURE_2D_MULTISAMPLE}}, {{KW|_GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}}, {{KW|_GL_PROXY_TEXTURE_CUBE_MAP}}, or {{KW|_GL_TEXTURE_BUFFER}}.
+
: 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.
; level
+
; mode
: Specifies the level-of-detail number of the desired image. Level 0 is the base image level. Level ''n'' is the ''n''th mipmap reduction image.
+
: Specifies a symbolic constant indicating the desired behavior. {{KW|_GL_FASTEST}}, {{KW|_GL_NICEST}}, and {{KW|_GL_DONT_CARE}} are accepted.
; pname
 
: Specifies the symbolic name of a texture parameter. {{KW|_GL_TEXTURE_WIDTH}}, {{KW|_GL_TEXTURE_HEIGHT}}, {{KW|_GL_TEXTURE_DEPTH}}, {{KW|_GL_TEXTURE_INTERNAL_FORMAT}}, {{KW|_GL_TEXTURE_BORDER}}, {{KW|_GL_TEXTURE_RED_SIZE}}, {{KW|_GL_TEXTURE_GREEN_SIZE}}, {{KW|_GL_TEXTURE_BLUE_SIZE}}, {{KW|_GL_TEXTURE_ALPHA_SIZE}}, {{KW|_GL_TEXTURE_DEPTH_SIZE}}, {{KW|_GL_TEXTURE_COMPRESSED}}, {{KW|_GL_TEXTURE_COMPRESSED_IMAGE_SIZE}}, and {{KW|_GL_TEXTURE_BUFFER_OFFSET}} are accepted.
 
; params
 
: Returns the requested data.
 
  
  
 
{{PageDescription}}
 
{{PageDescription}}
  
'''_glGetTexLevelParameter''' returns in {{Parameter|params}} texture parameter values for a specific level-of-detail value, specified as {{Parameter|level}}. {{Parameter|target}} defines the target texture, either {{KW|_GL_TEXTURE_1D}}, {{KW|_GL_TEXTURE_2D}}, {{KW|_GL_TEXTURE_3D}}, {{KW|_GL_PROXY_TEXTURE_1D}}, {{KW|_GL_PROXY_TEXTURE_2D}}, {{KW|_GL_PROXY_TEXTURE_3D}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_X}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y}}, {{KW|_GL_TEXTURE_CUBE_MAP_POSITIVE_Z}}, {{KW|_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z}}, or {{KW|_GL_PROXY_TEXTURE_CUBE_MAP}}.
+
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_MAX_TEXTURE_SIZE}}, and {{KW|_GL_MAX_3D_TEXTURE_SIZE}} are not really descriptive enough. It has to report the largest square texture image that can be accommodated with mipmaps and borders, but a long skinny texture, or a texture without mipmaps and borders, may easily fit in texture memory. The proxy targets allow the user to more accurately query whether the GL can accommodate a texture of a given configuration. If the texture cannot be accommodated, the texture state variables, which may be queried with '''_glGetTexLevelParameter''', are set to 0. If the texture can be accommodated, the texture state values will be set as they would be set for a non-proxy target.
+
; {{KW|_GL_FASTEST}}
 
 
{{Parameter|pname}} specifies the texture parameter whose value or values will be returned.
 
 
 
The accepted parameter names are as follows:
 
 
 
; {{KW|_GL_TEXTURE_WIDTH}}
 
 
:  
 
:  
{{Parameter|params}} returns a single value, the width of the texture image. This value includes the border of the texture image. The initial value is 0.
+
The most efficient option should be chosen.
; {{KW|_GL_TEXTURE_HEIGHT}}
+
; {{KW|_GL_NICEST}}
 
:  
 
:  
{{Parameter|params}} returns a single value, the height of the texture image. This value includes the border of the texture image. The initial value is 0.
+
The most correct, or highest quality, option should be chosen.
; {{KW|_GL_TEXTURE_DEPTH}}
+
; {{KW|_GL_DONT_CARE}}
 
:  
 
:  
{{Parameter|params}} returns a single value, the depth of the texture image. This value includes the border of the texture image. The initial value is 0.
+
No preference.
; {{KW|_GL_TEXTURE_INTERNAL_FORMAT}}
+
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:
 +
 
 +
; {{KW|_GL_FRAGMENT_SHADER_DERIVATIVE_HINT}}
 
:  
 
:  
{{Parameter|params}} returns a single value, the internal format of the texture image.
+
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_TEXTURE_RED_TYPE}},
+
; {{KW|_GL_LINE_SMOOTH_HINT}}
: ; {{KW|_GL_TEXTURE_GREEN_TYPE}},
 
: ; {{KW|_GL_TEXTURE_BLUE_TYPE}},
 
: ; {{KW|_GL_TEXTURE_ALPHA_TYPE}},
 
: ; {{KW|_GL_TEXTURE_DEPTH_TYPE}}
 
 
:  
 
:  
The data type used to store the component. The types {{KW|_GL_NONE}}, {{KW|_GL_SIGNED_NORMALIZED}}, {{KW|_GL_UNSIGNED_NORMALIZED}}, {{KW|_GL_FLOAT}}, {{KW|_GL_INT}}, and {{KW|_GL_UNSIGNED_INT}} may be returned to indicate signed normalized fixed-point, unsigned normalized fixed-point, floating-point, integer unnormalized, and unsigned integer unnormalized components, respectively.
+
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_TEXTURE_RED_SIZE}},
+
; {{KW|_GL_POLYGON_SMOOTH_HINT}}
: ; {{KW|_GL_TEXTURE_GREEN_SIZE}},
 
: ; {{KW|_GL_TEXTURE_BLUE_SIZE}},
 
: ; {{KW|_GL_TEXTURE_ALPHA_SIZE}},
 
: ; {{KW|_GL_TEXTURE_DEPTH_SIZE}}
 
 
:  
 
:  
The internal storage resolution of an individual component. The resolution chosen by the GL will be a close match for the resolution requested by the user with the component argument of {{KW|_glTexImage1D}}, {{KW|_glTexImage2D}}, {{KW|_glTexImage3D}}, {{KW|_glCopyTexImage1D}}, and {{KW|_glCopyTexImage2D}}. The initial value is 0.
+
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_COMPRESSED}}
+
; {{KW|_GL_TEXTURE_COMPRESSION_HINT}}
 
:  
 
:  
{{Parameter|params}} returns a single boolean value indicating if the texture image is stored in a compressed internal format. The initiali value is {{KW|_GL_FALSE}}.
+
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.
; {{KW|_GL_TEXTURE_COMPRESSED_IMAGE_SIZE}}
 
:
 
{{Parameter|params}} returns a single integer value, the number of unsigned bytes of the compressed texture image that would be returned from {{KW|_glGetCompressedTexImage}}.
 
; {{KW|_GL_TEXTURE_BUFFER_OFFSET}}
 
:
 
{{Parameter|params}} returns a single integer value, the offset into the data store of the buffer bound to a buffer texture. {{KW|_glTexBufferRange}}.
 
; {{KW|_GL_TEXTURE_BUFFER_SIZE}}
 
:
 
{{Parameter|params}} returns a single integer value, the size of the range of a data store of the buffer bound to a buffer texture. {{KW|_glTexBufferRange}}.
 
  
 
{{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.
 
 
'''_glGetTexLevelParameter''' returns the texture level parameters for the active texture unit.
 
 
 
{{KW|_GL_TEXTURE_BUFFER_OFFSET}} and {{KW|_GL_TEXTURE_BUFFER_SIZE}} 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.
 
 
{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|level}} is less than 0.
 
 
 
{{KW|_GL_INVALID_VALUE}} may be generated if {{Parameter|level}} is greater than log<sub>2</sub>(''max''), where ''max'' is the returned value of {{KW|_GL_MAX_TEXTURE_SIZE}}.
 
 
 
{{KW|_GL_INVALID_VALUE}} is generated if {{Parameter|target}} is {{KW|_GL_TEXTURE_BUFFER}} and {{Parameter|level}} is not zero.
 
 
 
{{KW|_GL_INVALID_OPERATION}} is generated if {{KW|_GL_TEXTURE_COMPRESSED_IMAGE_SIZE}} is queried on texture images with an uncompressed internal format or on proxy targets.
 
 
 
 
 
{{PageSeeAlso}}
 
 
 
{{KW|_GL}}
 
{{KW|_glActiveTexture}}, {{KW|_glBindTexture}}, {{KW|_glGetTexParameter}}
 
  
  
 
{{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/.