a3dAPI
Interface a3dRender

All Known Implementing Classes:
a3dGL4J, a3dSWH

public interface a3dRender

This is the public interface for the drivers. Soon you'll be able to instance the drivers directly and use them to render on the screen in a standard way (this will enbale to have custom world engines)

Author:
Andrea Fasce

Method Summary
 void beginScene()
          call this metodh before starting to send faces
 int createTexture()
          create a new texture
 void deleteTexture(int ID)
          delete texture
 void destroyDevice()
          destroy the device and frees all allocated datas
 void drawFace(float[] v0, float[] v1, float[] v2, int clip)
          draw a face given it's vertices and clipvalue
 void endScene()
          call this method when you've sent all faces
 int getHeight()
          returns the height of the screen
 int getWidth()
          returns the width of the rendering screen
 void resetDevice()
          reset this device deleting all textures and temporary datas
 void setBackgroundColor(float r, float g, float b)
          sets the background color
 void setBackgroundImage(int[] pix, int width, int height)
          sets the background image
 void setBilinear(boolean bilinear)
           
 void setFilter(int filter)
           
 void setFogActive(boolean flag)
          switch fog on/off
 void setFogLinear(float near, float far, float r, float g, float b)
          switch fog on and create a linear for
 void setKeyCode(java.lang.String key)
          sets the registartion code
 void setPerspective(float fov2, float fov, float near, float far)
          sets the values used by the camera
 void setRenderState(int textureID, boolean gouraud, float rAlpha)
          sets the render state for the rendering of all the next faces
 void setTextureBilinear(int ID, boolean bilinear)
          sets bilinear filtering of a texture
 void setTextureImage(int ID, int[] pix, int width, int height)
          sets the image of a texture
 

Method Detail

setBackgroundColor

public void setBackgroundColor(float r,
                               float g,
                               float b)
sets the background color
Parameters:
r - red component
g - green component
b - blue component

setBackgroundImage

public void setBackgroundImage(int[] pix,
                               int width,
                               int height)
sets the background image
Parameters:
pix - an array of 0xrrggbb values
width - width of the array
height - height of the array

createTexture

public int createTexture()
create a new texture
Returns:
the new id of the texture created

deleteTexture

public void deleteTexture(int ID)
delete texture
Parameters:
ID - texture ID to delete

setTextureImage

public void setTextureImage(int ID,
                            int[] pix,
                            int width,
                            int height)
sets the image of a texture
Parameters:
ID - the ID of the texture to modify
pix - an array of 0xrrggbb values
width - width of the array
height - height of the array

setTextureBilinear

public void setTextureBilinear(int ID,
                               boolean bilinear)
sets bilinear filtering of a texture
Parameters:
ID - the ID of the texture
bilinear - true/false to switch bilinear filtering on/off for that texture

setRenderState

public void setRenderState(int textureID,
                           boolean gouraud,
                           float rAlpha)
sets the render state for the rendering of all the next faces
Parameters:
textureID - ID of the texture to use or -1 if no texture is used
gouraud - true if the vertices contains color per vertex informations
rAlpha - a float in the range 0-1 to specify the alpha value

setBilinear

public void setBilinear(boolean bilinear)

beginScene

public void beginScene()
call this metodh before starting to send faces

endScene

public void endScene()
call this method when you've sent all faces

setFilter

public void setFilter(int filter)

resetDevice

public void resetDevice()
reset this device deleting all textures and temporary datas

destroyDevice

public void destroyDevice()
destroy the device and frees all allocated datas

drawFace

public void drawFace(float[] v0,
                     float[] v1,
                     float[] v2,
                     int clip)
draw a face given it's vertices and clipvalue
Parameters:
v0 - an array that contains: v0[0],v0[1],v0[2] = x,y,z of the vertices v0[3],v0[4],v0[5] = xr,yr,zr in screen coords v0[6],v0[7],v0[8] = r,g,b for the vertices v0[9],v0[10] = u,v for the vertices

getWidth

public int getWidth()
returns the width of the rendering screen
Returns:
width of the screen

getHeight

public int getHeight()
returns the height of the screen
Returns:
height of the screen

setFogActive

public void setFogActive(boolean flag)
switch fog on/off
Parameters:
flag - true/false fog on/off

setFogLinear

public void setFogLinear(float near,
                         float far,
                         float r,
                         float g,
                         float b)
switch fog on and create a linear for
Parameters:
near - near fog plane
far - far fog plane
r - fog red component
g - fog green component
b - fog blue component

setPerspective

public void setPerspective(float fov2,
                           float fov,
                           float near,
                           float far)
sets the values used by the camera
Parameters:
fov - fov of the camera
near - near camera plane
far - far camera plane

setKeyCode

public void setKeyCode(java.lang.String key)
sets the registartion code
Parameters:
key - the license code


(C)2000 by Andrea Fasce