Primitive Functions
This article is an overview of primitive and model related functions, these are a more simplified interface to drawing 3D primitives compared to vertex formats and vertex functions which are for advanced use, such as multitexturing.
These functions exist for drawing simple and quick primitives. They will draw and clear their vertex at the end of the primitive.
These are for 3D primitives.
- d3d_primitive_begin
- d3d_primitive_begin_texture
- d3d_primitive_end
- d3d_vertex
- d3d_vertex_color
- d3d_vertex_normal
- d3d_vertex_normal_color
- d3d_vertex_normal_texture
- d3d_vertex_normal_texture_color
- d3d_vertex_texture
- d3d_vertex_texture_color
These functions exist for creating and loading models, these are not the same as the primitive functions, in that you create the model once and then simply draw the model, so you don't have to specify the vertices each time you draw.
Note: Primitive adding can not be done after the first draw call for a model because at that point the models vertex data is buffered to the GPU.
- d3d_model_create
- d3d_model_destroy
- d3d_model_clear
- d3d_model_draw
- d3d_model_load
- d3d_model_save
- d3d_model_primitive_begin
- d3d_model_primitive_end
- d3d_model_vertex
- d3d_model_index
- d3d_model_vertex_color
- d3d_model_vertex_normal
- d3d_model_vertex_normal_color
- d3d_model_vertex_normal_texture
- d3d_model_vertex_normal_texture_color
- d3d_model_vertex_texture
- d3d_model_vertex_texture_color
These functions exist for drawing a basic shape in the draw event.
Note: Normals for basic shapes are automatically precalculated.
- d3d_draw_floor
- d3d_draw_wall
- d3d_draw_block
- d3d_draw_cone
- d3d_draw_cylinder
- d3d_draw_ellipsoid
- d3d_draw_icosahedron
- d3d_draw_torus
These functions are for adding a basic shape onto an existing model, they are generally quicker because many of them can be batched into few draw calls.