Example #1
0
//void xeeSubmit() {}
void xeeSubmit()
{	
	// never draw this one
	if (gl_cull_mode == GL_FRONT_AND_BACK)
		return;
		
	// update states if dirty
	XeUpdateStates();

	// update if dirty
	XeGlCheckDirtyMatrix(&projection_matrix);
	XeGlCheckDirtyMatrix(&modelview_matrix);
	
    // Xe_SetStreamSource(xe, 0, pVbGL, xe_PrevNumVerts * sizeof(glVerticesFormat_t), 10);
    Xe_SetShader(xe, SHADER_TYPE_VERTEX, pVertexShader, 0);
    
    int i = 0;
    // setup texture    
    for(i=0; i<XE_MAX_TMUS; i++) {    
		// set texture
		if (xeTmus[i].enabled && xeTmus[i].boundtexture) {
			Xe_SetTexture(xe, i, xeTmus[i].boundtexture->teximg);
		}
		else {
			Xe_SetTexture(xe, i, NULL);
		}
	}
	// setup shaders
	GL_SelectShaders();
	
	// draw
	Xe_DrawPrimitive(xe, Gl_Prim_2_Xe_Prim(xe_PrimitiveMode), xe_PrevNumVerts, Gl_Prim_2_Size(xe_PrimitiveMode, (xe_NumVerts - xe_PrevNumVerts)));
	
	//printBlendValue();
}
Example #2
0
static void GL_SubmitVertexes()
{	
	// never draw this one
	if (gl_cull_mode == GL_FRONT_AND_BACK)
		return;
	//Xe_SetFillMode(xe, XE_FILL_WIREFRAME, XE_FILL_WIREFRAME);
		
	// update states if dirty
	XeUpdateStates();

	// update if dirty
	XeGlCheckDirtyMatrix(&projection_matrix);
	XeGlCheckDirtyMatrix(&modelview_matrix);
	
    // Xe_SetStreamSource(xe, 0, pVbGL, xe_PrevNumVerts * sizeof(glVerticesFormat_t), 10);
    Xe_SetShader(xe, SHADER_TYPE_VERTEX, pVertexShader, 0);
    
   
	// setup shaders and textures
	GL_SelectShaders();
	GL_SelectTextures();
	
	// draw
	if (use_indice_buffer == 0)
	{	
		/*  Xe_DrawPrimitive(struct XenosDevice *xe, int type, int start, int primitive_count) */
		Xe_DrawPrimitive(xe, Gl_Prim_2_Xe_Prim(xe_PrimitiveMode), xe_PrevNumVerts, Gl_Prim_2_Size(xe_PrimitiveMode, (xe_NumVerts - xe_PrevNumVerts)));
	}
	else {
		/* Xe_DrawIndexedPrimitive(struct XenosDevice *xe, int type, int base_index, int min_index, int num_vertices, int start_index, int primitive_count) */
		Xe_SetIndices(xe, pIbGL);
		
		Xe_DrawIndexedPrimitive(xe, Gl_Prim_2_Xe_Prim(xe_PrimitiveMode), 
		0, 0,
		(xe_NumVerts - xe_PrevNumVerts), xe_PrevNumIndices, (xe_NumIndices - xe_PrevNumIndices));
		
		/*
		Xe_DrawIndexedPrimitive(xe,XE_PRIMTYPE_TRIANGLELIST, 
		0, 0,
		(xe_NumVerts - xe_PrevNumVerts), xe_PrevNumIndices, 2);
		*/ 
	}
	
	//printBlendValue();
}