RGB(r,v,b)
RGB12(r,v,b)
RGB15(r,v,b)
RGB16(r,v,b)
Creates a color from which you specify its red, green and blue components. The returned alpha is automatically set to 1, depending on the pixelformat, this means 15 for 4444 (RGB12), 1 for 5551 (RGB15), 0 for 5650 (RGB16) and 255 for 8888 (RGB).
RGBA(r,v,b)
RGBA12(r,v,b)
RGBA15(r,v,b)
Creates a color from which you specify its red, green and blue components. The alpha values define the color's transparency level. This can be used for anything, that is if you want to draw a semi-transparent text for example, you can do oslSetTextColor(RGBA(255,0,0,128)). So, each image pixel or each palette color can have its own transparency level. A null alpha value means complete transparency and the maximal value means it's completely opaque.
oslImageRotMoveX(img,x)
oslImageRotMoveY(img,y)
Defines the coordinates of an image in a way that with an angle of 0 the upper-left corner of the image is at the specified x,y position.
oslGetImageLine(img,y)
oslGetImagePixelAdr(img,x,y)
Returns a pointer to the image data, starting from the specified line or pixel. See the chapter about images for more informations.
oslGetUncachedPtr(adr)
Returns a pointer out of the cache. Use it to bypass the CPU cache.
oslDrawImageXY(img,px,py)
Draws an image at specified x,y coordinates.
oslDrawImageSimpleXY(img,px,py)
Idem but instead of that call oslDrawImageSimple.
oslAbs(x)
Returns the absolute value of the passed value.
oslSetImageTileSize(img,x0,y0,largeur,hauteur)
Defines the image part which we will draw when calling oslDrawImage. For example, if your image contains in fact several 16x16 "sprites" (small images) each placed next to the others, you can draw the third one (which is situated from the positions 32,0) like this:
oslSetImageTileSize(img, 32,0, 16,16); oslDrawImage(img);
oslSetImageTile(img,x0,y0,x1,y1)
Idem, but you specify the rectangle coordinates of the sub-image.
oslResetImageTile(img)
Call this to make an image have its normal size.
oslMirrorImageH(img)
oslMirrorImageV(img)
Mirrors an image horizontally (H) or vertically (V). You can then draw it using oslDrawImage.
Note: For experimented users, the image is not really mirrored, but just its internal coordinates that are modified,
so it's very fast.
oslCorrectImageHalfBorder(img)
Correct the problem which makes that a stretched image with bilinear filter enabled seems surrounded by a square. Execute it only in that case, otherwise your image will seem blurry or deformed!
oslResetImageHalfBorder(img)
Cancel the image half border correction.
oslGetDrawBuffer()
Returns the active drawbuffer (the image on which we're drawing).
oslPrintf(format...)
Standard printf on the screen. See the chapter about the text console for more informations.
oslCls()
Clears the screen (makes it black) and sets the cursor to the upper-left corner of the screen for oslPrintf.
oslMoveTo(x,y)
Moves the cursor to the specified positions.
The next oslPrintf will be made at this place.
Note: The positions are defined by character, and not by pixel, which means that if you do
oslMoveTo(100, 100), you will probably be outside of the screen, unless the police which you use can put more
than 100 characters horizontally and vertically on the screen.
oslPrintf_xy(x,y, str, format...)
Draws text at specified positions. This time, coordinates are specified by pixel.
oslAssert(cond)
It's a debugging utility only. It ensures that a condition is true before continue the program execution. Else, it will display a dialog indicating the condition, file and line number where the error occured.
oslDebug(format...)
Displays a message with the equivalent of a printf. It is very useful to debug your code. Example: oslDebug("str = %s", str);
oslMake3Buttons(b1,a1,b2,a2,b3,a3)
oslWarning(format...)
oslFatalError(format...)
Displays various error messages, based on oslMessageBox.
oslSetMaxFrameskip(val)
oslSetVSync(val)
oslSetFrameskip(val)
Sets the synchronization parameters, used by oslSyncFrame. See the oslSyncFrameEx description for more informations on these parameters.
oslSetKeyAutorepeat(keys,init,interval)
oslSetKeyAutorepeatMask(mask)
oslSetKeyAutorepeatInit(value)
oslSetKeyAutorepeatInterval(value)
Sets the global parameters to use with oslReadKeys. It's the same as setting directly osl_keys member. It is useful if you use exclusively osl_keys and oslReadKeys.
oslSetSoundEndCallback(s, fct)
Allows to define a function which will be executed when the sound will be ended. You can at this moment replay the same sound in a loop for example, or launch another one. The function returns an integer (int) and takes two arguments: int oslAudioEndCallback(OSL_SOUND *s, int no_voie); The function has to return 1 if there is another sound to be played or 0 if it is ended for this channel (it will be then free for another sound). Here is an example which replays the same sound on the same channel in a loop:
int replay(OSL_SOUND *s, int voice) { oslPlaySound(s, voice); return 1; } [...] music = oslLoadSoundFile("test.bgm", OSL_FMT_STREAM); oslSetSoundEndCallback(music, replay);