00001
00002
00003 #include "DefaultObjects.h"
00004
00005 #ifndef RC_SCENEGRAPH_H
00006 #define RC_SCENEGRAPH_H
00007
00008
00009
00017 class SceneGraph {
00018
00019
00020
00021 public:
00028 static void init();
00029
00036 static void destroy();
00037
00038 static void registerCommands();
00039
00040
00041
00042
00043
00056 static void deleteNode(
00057 Node *node
00058 );
00059
00060
00061
00069 static World *createWorld(
00070 const char *nname
00071 );
00072
00073
00074
00075
00083 static Group *createGroup(
00084 const char *nname
00085 );
00086
00102 static Group *createGroup(
00103 const char *group_name,
00104 const char *filename
00105 );
00106
00107
00115 static Camera *createCamera(
00116 const char *nname
00117 );
00118
00119
00127 static Light *createLight(
00128 const char *nname
00129 );
00130
00131
00139 static Geometry *createGeometry(
00140 const char *nname
00141 );
00142
00155 static Geometry *createGeometry(
00156 const char *nname,
00157
00158 VertexArray *vertex_array,
00159
00160 bool instantiate_resources = true
00161 );
00162
00183 static Geometry *createGeometry(
00184 const char *nname,
00185 const char *filename,
00186
00187 bool instantiate_resources = true
00188 );
00189
00190
00191
00205 static Node *getNode(
00206 const char *name
00207 );
00208
00209
00210 static u32 getNodeCount();
00211
00225 static void getNodes(
00226 Node **node_list
00227 );
00228
00253 static void getNodes(
00254 const char *name,
00255 u32 max_nodes,
00256 Node **node_list,
00257 u32 *n
00258 );
00259
00260
00265 static u32 getNodeCount(
00266 NodeType_t type
00267 );
00268
00269
00286 static void getNodes(
00287 Node **node_list,
00288 NodeType_t type
00289 );
00290
00318 static void getNodes(
00319 const char *name,
00320 u32 max_nodes,
00321 Node **node_list,
00322 u32 *n,
00323 NodeType_t type
00324 );
00325
00326
00327
00328
00329
00330
00331
00332
00346 static bool dereferenceResource(
00347 Resource *resource
00348 );
00349
00360 static void purgeResources(
00361 u32 max_purge_level
00362 );
00363
00376 static void forcePurgeResources(
00377 u32 max_purge_level
00378 );
00379
00380
00381
00405 static VertexArray *createVertexArray(
00406 const char *nidentifier,
00407
00408 void *new_array,
00409 u32 nstride,
00410 u32 n,
00411
00412 PrimitiveLayout_t layout,
00413
00414 AttributeUsage_t usage
00415 );
00416
00437 static VertexArray *createVertexArray(
00438 const char *nidentifier,
00439
00440 u32 nstride,
00441
00442 PrimitiveLayout_t layout,
00443
00444 AttributeUsage_t usage
00445 );
00446
00473 static Texture *createTexture(
00474 const char *nidentifier,
00475 const char *filename,
00476 bool generate_mipmaps,
00477 TextureFilter_t filter,
00478 TextureWrap_t wrap
00479 );
00480
00512 static Texture *createTexture(
00513 const char *nidentifier,
00514 u8 *pixels,
00515
00516 TextureFormat_t nformat,
00517
00518 u32 nwidth,
00519 u32 nheight,
00520
00521 bool generate_mipmaps,
00522 TextureFilter_t filter,
00523 TextureWrap_t wrap
00524 );
00525
00526
00539 static RenderTarget *createRenderTarget(
00540 const char *nidentifier,
00541
00542 u32 width,
00543 u32 height,
00544
00545 u32 n_target_textures,
00546
00547 bool depth_buffer,
00548 bool stencil_buffer,
00549 TextureFilter_t textureFilter
00550 );
00551
00561 static CubeMap *createCubeMap(
00562 const char *nidentifier,
00563
00564 const char *nleft,
00565 const char *nright,
00566 const char *nup,
00567 const char *ndown,
00568 const char *nfront,
00569 const char *nback
00570 );
00571
00572
00593 static ShaderProgram *createShaderProgram(
00594 const char *nidentifier,
00595
00596 const char *shader_name,
00597 char *prefix
00598 );
00599
00600
00601
00602
00610 static Resource *getResource(
00611 const char *identifier,
00612 ResourceType_t type
00613 );
00614
00615
00616 static u32 getResourceCount(
00617 ResourceType_t type
00618 );
00619
00628 static void getResourceList(
00629 Resource **list,
00630 ResourceType_t type
00631 );
00632
00633
00634
00639 static void printDebugInfo();
00640
00641
00642
00643
00644 protected:
00645 static ResourceList *vertexList;
00646 static ResourceList *renderTargetList;
00647 static ResourceList *textureList;
00648 static ResourceList *cubeMapList;
00649 static ResourceList *shaderProgramList;
00650
00651 static NodeList *nodeList;
00652 };
00653
00654 #endif
00655