コード例 #1
0
ファイル: 3dinterface.cpp プロジェクト: AspireONE/berusky2
void poly_vertex_array_upload_ati(EDIT_MESH_POLY * p_poly)
{
  glUpdateObjectBufferATI(p_poly->varray.ati_handle, 0,
    sizeof(p_poly->p_koord[0]) * p_poly->facenum, p_poly->p_koord,
    GL_DISCARD_ATI);
}
JNIEXPORT void JNICALL Java_org_lwjgl_opengl_ATIVertexArrayObject_nglUpdateObjectBufferATI(JNIEnv *env, jclass clazz, jint buffer, jint offset, jint size, jlong pPointer, jint preserve, jlong function_pointer) {
	const GLvoid *pPointer_address = (const GLvoid *)(intptr_t)pPointer;
	glUpdateObjectBufferATIPROC glUpdateObjectBufferATI = (glUpdateObjectBufferATIPROC)((intptr_t)function_pointer);
	glUpdateObjectBufferATI(buffer, offset, size, pPointer_address, preserve);
}
コード例 #3
0
ファイル: 3dinterface.cpp プロジェクト: AspireONE/berusky2
void mesh_vertex_array_upload_ati(GAME_MESH_OLD * p_mesh)
{
  VERTEX_ARRAYS *p_va = &p_mesh->varray;
  int handle = p_mesh->varray.ati_handle;
  int vertexu = p_mesh->vertexnum,
    k2flag = p_mesh->p_data->k2flag,
    m2flag = p_mesh->p_data->m2flag, kflag = p_mesh->p_data->kflag;
  int norm = glstav_pn_triangles
    || p_mesh->
    p_data->m2flag & (MAT2_CALC_MAP1 | MAT2_CALC_MAP2 | MAT2_CALC_MAP3 |
    MAT2_CALC_MAP4);

  if (k2flag & KONT2_UPDATE_POS)
    glUpdateObjectBufferATI(handle, p_va->ati_start_pos,
      sizeof(p_mesh->p_vertex_pos[0]) * vertexu, p_mesh->p_vertex_pos,
      GL_PRESERVE_ATI);

  if (norm && k2flag & KONT2_UPDATE_NORM)
    glUpdateObjectBufferATI(handle, p_va->ati_start_norm,
      sizeof(p_mesh->p_vertex_norm[0]) * vertexu, p_mesh->p_vertex_norm,
      GL_PRESERVE_ATI);

  if (k2flag & KONT2_UPDATE_DIFF && m2flag & MAT2_DIFFUSE) {
    if (kflag & KONT_DRAW_VODA) {
      glUpdateObjectBufferATI(handle, p_va->ati_start_diff,
        sizeof(p_mesh->p_vertex_diff_voda[0]) * vertexu,
        p_mesh->p_vertex_diff_voda, GL_PRESERVE_ATI);
    }
    else {
      glUpdateObjectBufferATI(handle, p_va->ati_start_diff,
        sizeof(p_mesh->p_vertex_diff[0]) * vertexu, p_mesh->p_vertex_diff,
        GL_PRESERVE_ATI);
    }
  }

  if (k2flag & KONT2_UPDATE_SPEC) {
    if (kflag & KONT_DRAW_VODA) {
      glUpdateObjectBufferATI(handle, p_va->ati_start_spec,
        sizeof(p_mesh->p_vertex_spec_voda[0]) * vertexu,
        p_mesh->p_vertex_spec_voda, GL_PRESERVE_ATI);
    }
    else {
      glUpdateObjectBufferATI(handle, p_va->ati_start_spec,
        sizeof(p_mesh->p_vertex_spec[0]) * vertexu, p_mesh->p_vertex_spec,
        GL_PRESERVE_ATI);
    }
  }

  if (k2flag & KONT2_UPDATE_TEXT1)
    glUpdateObjectBufferATI(handle, p_va->ati_start_text[0],
      sizeof(p_mesh->p_vertex_uv1_material[0]) * vertexu,
      p_mesh->p_vertex_uv1_material, GL_PRESERVE_ATI);

  if (k2flag & KONT2_UPDATE_TEXT2)
    glUpdateObjectBufferATI(handle, p_va->ati_start_text[1],
      sizeof(p_mesh->p_vertex_uv2_material[0]) * vertexu,
      p_mesh->p_vertex_uv2_material, GL_PRESERVE_ATI);

  if (k2flag & KONT2_UPDATE_TEXT3)
    glUpdateObjectBufferATI(handle, p_va->ati_start_text[2],
      sizeof(p_mesh->p_vertex_uv3_material[0]) * vertexu,
      p_mesh->p_vertex_uv3_material, GL_PRESERVE_ATI);

  if (k2flag & KONT2_UPDATE_TEXT4)
    glUpdateObjectBufferATI(handle, p_va->ati_start_text[3],
      sizeof(p_mesh->p_vertex_uv4_material[0]) * vertexu,
      p_mesh->p_vertex_uv4_material, GL_PRESERVE_ATI);

  p_mesh->p_data->k2flag &= ~(KONT2_UPLOAD);
}