Low-level drawing routines, closer to the hardware and thus faster.
◆ oslEnableTexturing
#define oslEnableTexturing |
( |
| ) |
|
Value:
int osl_textureEnabled
Indicates if texturing is currently enabled.
Disables texturing, making the image opaque and drawn using vertex colors.
◆ oslDisableTexturing
#define oslDisableTexturing |
( |
| ) |
|
Value:Enables texturing. This function should not be called directly; it is managed by oslSetTexture.
◆ OSL_SLICE_SIZE
#define OSL_SLICE_SIZE 64 |
Defines the maximum width of an image stripe for efficient drawing. Images wider than this value should be drawn in multiple stripes. For example, if the image width is 256 pixels, it should be drawn in 4 stripes, each 64 pixels wide. This prevents performance issues related to handling large images.
◆ OSL_TEXWRAP_MODES
Available values for oslSetTextureWrap.
Enumerator |
---|
OSL_TW_REPEAT | Repeats the texture. The texture tiles indefinitely.
|
OSL_TW_CLAMP | Clamps the texture. The last pixel of the texture is repeated indefinitely beyond its bounds.
|
◆ oslVerifyStripBlit()
This function is intended for internal use only by oslDrawImageSimple
. It is used to verify or handle strip blitting operations for images. Generally, this function manages how images are processed when they are too large to be handled in one go and need to be split into smaller strips for efficient rendering.
Do not use or modify this function directly. For details on its usage, refer to the source code of oslDrawImageSimple
.
◆ oslSetTexture()
Defines the current texture for low-level image drawing.
This function sets the texture to be used for rendering operations. It specifies which image should be applied as a texture when drawing objects. The texture image must be in video memory (VRAM) and should be in a non-paletted format (e.g., 4444, 5551, 5650).
- Parameters
-
img | A pointer to the OSL_IMAGE structure that represents the image to be used as the texture. The image should be loaded into video memory for proper texture mapping. |
- Note
- The image must be in video memory (OSL_IN_VRAM) for the texture to be applied correctly.
- Ensure that the image format is compatible with the texturing requirements of the GPU.
- Calling this function changes the current texture state, so you should call it before each drawing operation if you are using different textures.
◆ oslSetTexturePart()
void oslSetTexturePart |
( |
OSL_IMAGE * | img, |
|
|
int | x, |
|
|
int | y ) |
|
extern |
Defines the current texture and its starting coordinates for rendering.
This function sets a texture and specifies the beginning coordinates within the texture. It is useful for handling large textures by breaking them into smaller 512x512 sections.
- Parameters
-
img | A pointer to the OSL_IMAGE structure representing the texture image. The image should be in video memory (VRAM) and should be in a non-paletted format. |
x | The x-coordinate (horizontal) of the starting point within the texture, which should be a multiple of 512. |
y | The y-coordinate (vertical) of the starting point within the texture, which should be a multiple of 512. |
The coordinates (x, y) will be mapped to (u, v) = (0, 0) when drawing the texture, allowing access to a 512x512 portion of the texture.
◆ oslBlendColors()
Blends two colors together.
This function combines two colors using a blending algorithm. It is used internally and is not recommended for direct use in application code.
- Parameters
-
c1 | The first color to blend. |
c2 | The second color to blend. |
- Returns
- The blended color result.
◆ osl_currentTexWrapU
Holds the current texture wrap state for the U coordinate.
◆ osl_currentTexWrapV
Holds the current texture wrap state for the V coordinate.
◆ osl_list
System display list for low-level drawing operations.
This pointer holds the address of the system's display list used for rendering graphics. It is utilized internally by OSLib for managing drawing commands and operations.
◆ osl_textureEnabled
Indicates if texturing is currently enabled.
This variable holds the state of the texturing feature. It is set to a non-zero value when texturing is enabled, and to zero when it is disabled. This state controls whether textures are applied to drawn objects.
◆ osl_curTexture
Current texture being used for drawing.
This pointer holds the current texture that has been set for drawing operations. It is used internally to avoid redundant texture setting operations if the texture hasn't changed.
◆ osl_curPalette
Current palette being used.
This pointer holds the current palette that has been set for drawing operations. It is used internally to avoid redundant palette uploads if the palette hasn't changed.
◆ osl_curDrawBuf
Current draw buffer being used.
This pointer holds the current draw buffer where drawing operations are being directed. It helps to manage the active drawing target and avoid unnecessary buffer switches.
◆ osl_curDispBuf
Current display buffer being used.
This pointer holds the current display buffer that is being used for displaying the final output. It is part of the internal mechanism for managing what is shown on screen.
◆ osl_defaultBufferImage
Default and secondary buffers.
These represent the default and secondary buffers used in OSLib. The osl_defaultBufferImage
is the primary buffer where the image is drawn, while osl_secondaryBufferImage
is used for double buffering. osl_curBuf
points to the currently active buffer.
◆ osl_isDrawingStarted
Flag indicating if drawing has started.
This flag indicates whether drawing operations have been initiated. It helps in managing and coordinating drawing processes within OSLib.