1 package com.insanityengine.ghia.renderer; 2 3 import com.insanityengine.ghia.m3.*; 4 import com.insanityengine.ghia.pixels.*; 5 import com.insanityengine.ghia.libograf.*; 6 7 /*** 8 * 9 * <P> 10 * Attempts to define an interface for rendering polygons 11 * </P> 12 * 13 * @author BrianHammond 14 * 15 * $Header: /usr/local/cvsroot/ghia/src/java/com/insanityengine/ghia/renderer/RendererInterface.java,v 1.5 2005/03/19 17:50:02 brian Exp $ 16 * 17 */ 18 19 public interface RendererInterface extends DrawerRegistryInterface { 20 21 /*** 22 * 23 * Invoke any drawing routines etc 24 * 25 * @param context to use to render 26 * 27 */ 28 public void render( LiboGraf context ); 29 30 /*** 31 * 32 * Initialize the RendererInterface implementation. These 33 * arguments should be sufficient for all implementations (!!!), 34 * but may need to be made more extensible (RendererContextInterface?) 35 * 36 * @param width of the display 37 * @param height of the display 38 * @param component to use to create offscreen buffer 39 * 40 */ 41 public void init( int width, int height, java.awt.Component component ); 42 43 /*** 44 * 45 * Draw a polygon 46 * 47 * @param count of points 48 * @param ptz the array of Pt3 to draw 49 * 50 */ 51 public void drawPolygon( int count, Pt3[] ptz ); 52 53 /*** 54 * 55 * Get the clear color 56 * 57 * @return the clear color 58 * 59 */ 60 public int getClearColor(); 61 62 /*** 63 * 64 * Set the clear color 65 * 66 * @return color to clear with 67 * 68 */ 69 public void setClearColor( int color ); 70 71 /*** 72 * 73 * Set depth testing policy 74 * 75 * @param testDepth false disables test 76 * 77 */ 78 public void setDepthTesting( boolean testDepth ); 79 80 /*** 81 * 82 * Clear the depth buffer 83 * 84 */ 85 public void clearDepthBuffer(); 86 87 /*** 88 * 89 * Clear the pixel/color buffer 90 * 91 */ 92 public void clearColorBuffer(); 93 94 /*** 95 * 96 * Set the shading method 97 * 98 * @param method may be listed in M3_Constants 99 * 100 */ 101 public void setShadingMethod( int method ); 102 103 /*** 104 * 105 * Set the texture function 106 * 107 * @param function may be listed in M3_Constants 108 * 109 */ 110 public void setTextureFunction( int function ); 111 112 /*** 113 * 114 * Set the current normal 115 * 116 * @param point to use as the current normal 117 * 118 */ 119 public void setNormal( Pt3 point ); 120 121 /*** 122 * 123 * Set the current ImageSkin 124 * 125 * @param imageskin to use 126 * 127 */ 128 public void setSkin( ImageSkin skin ); 129 130 /*********************************************************************/ 131 132 /*** 133 * 134 * Set the image observer 135 * 136 * @param observer to use 137 * 138 */ 139 public void setObserver( java.awt.image.ImageObserver observer ); 140 141 /*** 142 * 143 * Determines the width of the buffer. 144 * 145 * @return the width of this buffer 146 * 147 */ 148 public int getWidth(); 149 150 /*** 151 * 152 * Determines the height of the buffer. 153 * 154 * @return the height of this buffer 155 * 156 */ 157 public int getHeight(); 158 159 /*** 160 * 161 * Clear the buffer 162 * 163 */ 164 public void clear(); 165 166 }; 167 168 /*** 169 * 170 * $Log: RendererInterface.java,v $ 171 * Revision 1.5 2005/03/19 17:50:02 brian 172 * repackaging 173 * 174 * Revision 1.4 2004/09/11 14:37:21 brian 175 * added RendererConsumer and stuff 176 * 177 * Revision 1.3 2004/09/05 03:41:31 brian 178 * refactored to have the render method of the renderers invoke the drawingIfz 179 * 180 * Revision 1.2 2004/09/02 23:32:26 brian 181 * dont make the RendererInterface extend PixelBufferInterface 182 * 183 * Revision 1.1 2004/09/02 13:17:16 brian 184 * the big reorg 185 * 186 * Revision 1.4 2004/09/01 01:10:42 brian 187 * fix class level javadoc placement 188 * 189 * Revision 1.3 2004/09/01 00:11:06 brian 190 * author, log and header stuff 191 * 192 * 193 */