DEMOGL_LoadingPBSetAppearance
- DEMOGL_LoadingPBSetAppearance sets the appearance of the progress bar build into DemoGL and which is enabled
by using DEMOGL_LoadingPBEnable.
void
DEMOGL_LoadingPBSetAppearance(
const bool bHorizontal,
const bool bBlend,
const GLenum iBlendSrc,
const GLenum iBlendDst,
const float fOpacity,
const float fBGColor_R,
const float fBGColor_G,
const float fBGColor_B,
const float fBarColor_R,
const float fBarColor_G,
const float fBarColor_B
);
- Parameters.
- bHorizontal
- Specifies if the progress bar should be a horizontal progress bar (true) or a vertical (false).
- bBlend
- Specifies if the progress bar should be blended with the contents of the framebuffer. This way you
can create semi transparent progress bars. If bBlend is false, iBlendSrc and
iBlendDst are ignored.
- iBlendSrc
- Specifies the source color fragment blending function. Similar to the first
parameter of OpenGL function glBlendFunc. See that function for possible values for iBlendSrc
- iBlendDst
- Specifies the destination color fragment blending function. Similar to the second
parameter of OpenGL function glBlendFunc. See that function for possible values for iBlendDst
- fOpacity
- Specifies the alpha value of the background and bar itself. When bBlend is false this value
will not have any effect. This value should be in the range [0.0, 1.0]. OpenGL will clamp all values
outside this range to this range.
- fBGColor_R
- Specifies the red color fragment of the background of the progress bar.
This value should be in the range [0.0, 1.0]. OpenGL will clamp all values outside this range to this range.
- fBGColor_G
- Specifies the green color fragment of the background of the progress bar.
This value should be in the range [0.0, 1.0]. OpenGL will clamp all values outside this range to this range.
- fBGColor_B
- Specifies the blue color fragment of the background of the progress bar.
This value should be in the range [0.0, 1.0]. OpenGL will clamp all values outside this range to this range.
- fBarColor_R
- Specifies the red color fragment of the enlarging bar of the progress bar.
This value should be in the range [0.0, 1.0]. OpenGL will clamp all values outside this range to this range.
- fBarColor_G
- Specifies the green color fragment of the enlarging bar of the progress bar.
This value should be in the range [0.0, 1.0]. OpenGL will clamp all values outside this range to this range.
- fBarColor_B
- Specifies the blue color fragment of the enlarging bar of the progress bar.
This value should be in the range [0.0, 1.0]. OpenGL will clamp all values outside this range to this range.
- Return values.
- Remarks.
- After you've enabled the progress bar with
DEMOGL_LoadingPBEnable, you can give it
a custom look with DEMOGL_LoadingPBSetAppearance. The progress bar has the same size for background and
enlarging bar. It's important to understand that the width and height specified with
DEMOGL_LoadingPBEnable will affect different
sides of the progress bar when bHorizontal is flipped from true to false or vice versa. So you
should first determine if your progress bar is a horizontal or vertical bar and then determine the width and height.
When this function is called, it will have effect immediately, you can call this function more times after eachother,
for example from every Init() method of all your effects.
- Example.
// Enable the progress bar at the bottom of the screen, screenwide.
// Make it a linear progress bar.
DEMOGL_LoadingPBEnable(DGL_CNTRL_PGB_LINEAR, 1.0f, 0.02f, 0.0f, 0.0f);
// Set Progress bar appearance. Make it horizontal
DEMOGL_LoadingPBSetAppearance(true, false, GL_SRC_COLOR,
GL_ONE_MINUS_SRC_COLOR, 1.0f, 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, 1.0f);
- Requirements.
- DemoGL v1.3 (build 0112 or higher)
- See also.
- DEMOGL_LoadingPBEnable