DemoGL::Reference::Functions::DEMOGL_LoadingPBEnable

DEMOGL_LoadingPBEnable

DEMOGL_LoadingPBEnable enables the progress bar build into DemoGL, plus sets the lower left corner of the progress bar plus the width and height. This progress bar is visible during the startup of the application and will reflect the amount of work done before the effect objects will be executed.

void
DEMOGL_LoadingPBEnable(
	const int iType,
	const float fWidth, 
	const float fHeight,
	const float fBottomLeftX, 
	const float fBottomLeftY
);
	
Parameters.
iType
Progress bar type Description
DGL_CNTRL_PGB_LINEAR A linear progress bar is shown with an increasing bar without delineated squares.
DGL_CNTRL_PGB_BLOCKS_2D A progress bar of delineated squares is shown.

fWidth
The width of the progress bar on screen, in (percentage/100).
fHeight
The height of the progress bar on screen, in (percentage of the screen/100).
fBottomLeftX
The X coordinate of the bottom left corner of the progress bar, in OpenGL floating point 2D coordinates. (0.0f, 0.0f) is the bottom left coordinate of the screen.
fBottomLeftY
The Y coordinate of the bottom left corner of the progress bar, in OpenGL floating point 2D coordinates. (0.0f, 0.0f) is the bottom left coordinate of the screen.

Return values.

Remarks.
The progress bar is a 2D component that is rendered on top of the splash screen, during startup of the application. Besides the placement and the size properties, the appeance of the progress bar is also settable, via DEMOGL_LoadingPBSetAppearance. DemoGL will set the max value of the progress bar to (number of registered effects) + 5. It will automatically tick from the minimum of 0 to that max value every time an internal process has finished, during startup of the application, or an effect is initialized. Keep in mind to use floating point OpenGL 2D coordinates, so the placement and size is resolution independant. Be sure to call this function before you start your application with DEMOGL_AppRun, otherwise the progress bar won't show up. When you choose to use DGL_CNTRL_PGB_BLOCKS_2D as iType for the progress bar, the progress bar will have max value amount of 2D delineated squares.

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_AppRun, DEMOGL_LoadingPBSetAppearance

Last changed on 20-jan-2001

©1999-2001 Solutions Design