|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This is the interface for 2D renderer. The 2D renderer is responsible for all 2D operations such as creating the window, switching pages, returning pixel format and so on.
| Method Summary | |
void |
allowResize(boolean iAllow)
Enable/disable canvas resizing. |
boolean |
beginDraw()
This routine should be called before any draw operations. |
void |
blit(int x,
int y,
int width,
int height,
byte[] data)
Blit a memory block. |
void |
clear(int color)
Clear backbuffer. |
void |
clearAll(int color)
Clear all video pages. |
boolean |
clipLine(float x1,
float y1,
float x2,
float y2,
int xmin,
int ymin,
int xmax,
int ymax)
Clip a line against given rectangle. |
void |
close()
Close the device. |
iGraphics2D |
createOffscreenCanvas(iPointer memory,
int width,
int height,
int depth,
iOffscreenCanvasCallback ofscb)
Create an off-screen canvas so you can render on a given memory area. |
boolean |
doubleBuffer(boolean Enable)
Enable or disable double buffering; returns success status. |
void |
drawBox(int x,
int y,
int w,
int h,
int color)
Draw a box. |
void |
drawLine(float x1,
float y1,
float x2,
float y2,
int color)
Draw a line. |
void |
drawPixel(int x,
int y,
int color)
Draw a pixel. |
void |
drawPixels(csPixelCoord pixels,
int num_pixels,
int color)
Draw an array of pixel coordinates with the given color. |
int |
findRGB(int r,
int g,
int b)
Find an RGB color. |
void |
finishDraw()
This routine should be called when you finished drawing. |
void |
freeArea(csImageArea Area)
Free storage allocated for a subarea of screen. |
int[] |
getClipRect()
Retrieve clipping rectangle. |
boolean |
getDoubleBufferState()
Get the double buffer state. |
iFontServer |
getFontServer()
Get the active font server (does not do IncRef(););. |
boolean |
getFullScreen()
Returns 'true' if the program is being run full-screen. |
float |
getGamma()
Get gamma value. |
int |
getHeight()
Return the height of the framebuffer. |
iNativeWindow |
getNativeWindow()
Get the native window corresponding with this canvas. |
int |
getPage()
Get active videopage number (starting from zero);. |
int |
getPalEntryCount()
Return the number of palette entries that can be modified. |
csRGBpixel |
getPalette()
Get the palette (if there is one);. |
byte[] |
getPixel(int x,
int y)
Query pixel R,G,B at given screen location. |
iPointer |
getPixelAt(int x,
int y)
Returns the address of the pixel at the specified (x, y); coordinates. |
int |
getPixelBytes()
Return the number of bytes for every pixel. |
csPixelFormat |
getPixelFormat()
Return information about the pixel format. |
int |
getWidth()
Return the width of the framebuffer. |
boolean |
open()
Open the device. |
void |
print(csRect pArea)
Flip video pages (or dump backbuffer into framebuffer);. |
boolean |
resize(int w,
int h)
Resize the canvas. |
void |
restoreArea(csImageArea Area,
boolean Free)
Restore a subarea of screen saved with SaveArea();. |
csImageArea |
saveArea(int x,
int y,
int w,
int h)
Save a subarea of screen and return a handle to saved buffer. |
iImage |
screenShot()
Do a screenshot: return a new iImage object. |
void |
setClipRect(int nMinX,
int nMinY,
int nMaxX,
int nMaxY)
Set clipping rectangle. |
void |
setFullScreen(boolean b)
Change the fullscreen state of the canvas. |
boolean |
setGamma(float gamma)
Set gamma value (if supported by canvas);. |
boolean |
setMouseCursor(iImage image,
csRGBcolor keycolor)
Set mouse cursor using an image. |
boolean |
setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x)
Set mouse cursor using an image. |
boolean |
setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x,
int hotspot_y)
Set mouse cursor using an image. |
boolean |
setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x,
int hotspot_y,
csRGBcolor fg)
Set mouse cursor using an image. |
boolean |
setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x,
int hotspot_y,
csRGBcolor fg,
csRGBcolor bg)
Set mouse cursor using an image. |
boolean |
setMouseCursor(int iShape)
Set mouse cursor to one of predefined shape classes (see csmcXXX enum above);. |
boolean |
setMousePosition(int x,
int y)
Set mouse position (relative to top-left of CS window);. |
void |
setRGB(int i,
int r,
int g,
int b)
Set a color index to given R,G,B (0..255); values. |
void |
write(iFont font,
int x,
int y,
int fg,
int bg,
java.lang.String str)
Write a text string into the back buffer. |
void |
write(iFont font,
int x,
int y,
int fg,
int bg,
java.lang.String str,
int flags)
Write a text string into the back buffer. |
void |
writeBaseline(iFont font,
int x,
int y,
int fg,
int bg,
java.lang.String str)
Deprecated. Instead, use Write(); with the CS_WRITE_BASELINE flag set. Implemented in csGraphics2D, and csGraphics2DNull. |
| Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase |
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe |
| Methods inherited from interface crystalspace.jbind.interfaces.iPointer |
changePointer, getPointer, isMemoryOwner, setMemoryOwner |
| Method Detail |
public void allowResize(boolean iAllow)
iAllow - public boolean beginDraw()
public void blit(int x,
int y,
int width,
int height,
byte[] data)
x - y - width - height - data - public void clear(int color)
color - public void clearAll(int color)
color -
public boolean clipLine(float x1,
float y1,
float x2,
float y2,
int xmin,
int ymin,
int xmax,
int ymax)
x1 - y1 - x2 - y2 - xmin - ymin - xmax - ymax -
public void close()
public iGraphics2D createOffscreenCanvas(iPointer memory,
int width,
int height,
int depth,
iOffscreenCanvasCallback ofscb)
memory - width - height - depth - ofscb -
public boolean doubleBuffer(boolean Enable)
Enable -
public void drawBox(int x,
int y,
int w,
int h,
int color)
x - y - w - h - color -
public void drawLine(float x1,
float y1,
float x2,
float y2,
int color)
x1 - y1 - x2 - y2 - color -
public void drawPixel(int x,
int y,
int color)
x - y - color -
public void drawPixels(csPixelCoord pixels,
int num_pixels,
int color)
pixels - num_pixels - color -
public int findRGB(int r,
int g,
int b)
r - g - b -
public void finishDraw()
public void freeArea(csImageArea Area)
Area - public int[] getClipRect()
public boolean getDoubleBufferState()
public iFontServer getFontServer()
public boolean getFullScreen()
public float getGamma()
public int getHeight()
public iNativeWindow getNativeWindow()
public int getPage()
public int getPalEntryCount()
public csRGBpixel getPalette()
public byte[] getPixel(int x,
int y)
x - y -
public iPointer getPixelAt(int x,
int y)
x - y -
public int getPixelBytes()
public csPixelFormat getPixelFormat()
public int getWidth()
public boolean open()
public void print(csRect pArea)
pArea -
public boolean resize(int w,
int h)
w - h -
public void restoreArea(csImageArea Area,
boolean Free)
Area - Free -
public csImageArea saveArea(int x,
int y,
int w,
int h)
x - y - w - h -
public iImage screenShot()
public void setClipRect(int nMinX,
int nMinY,
int nMaxX,
int nMaxY)
nMinX - nMinY - nMaxX - nMaxY - public void setFullScreen(boolean b)
b - public boolean setGamma(float gamma)
gamma -
public boolean setMouseCursor(iImage image,
csRGBcolor keycolor)
image - keycolor -
public boolean setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x)
image - keycolor - hotspot_x -
public boolean setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x,
int hotspot_y)
image - keycolor - hotspot_x - hotspot_y -
public boolean setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x,
int hotspot_y,
csRGBcolor fg)
image - keycolor - hotspot_x - hotspot_y - fg -
public boolean setMouseCursor(iImage image,
csRGBcolor keycolor,
int hotspot_x,
int hotspot_y,
csRGBcolor fg,
csRGBcolor bg)
image - keycolor - hotspot_x - hotspot_y - fg - bg -
public boolean setMouseCursor(int iShape)
iShape -
public boolean setMousePosition(int x,
int y)
x - y -
public void setRGB(int i,
int r,
int g,
int b)
i - r - g - b -
public void write(iFont font,
int x,
int y,
int fg,
int bg,
java.lang.String str)
font - x - y - fg - bg - str -
public void write(iFont font,
int x,
int y,
int fg,
int bg,
java.lang.String str,
int flags)
font - x - y - fg - bg - str - flags -
public void writeBaseline(iFont font,
int x,
int y,
int fg,
int bg,
java.lang.String str)
font - x - y - fg - bg - str -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||