Edit

kc3-lang/angle/util/geometry_utils.h

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2015-09-22 12:40:31
    Hash : ad60e8ee
    Message : Move more sample_util sources to util. These sample utils can also be useful for writing perf tests. BUG=angleproject:1164 Change-Id: I44b5d63b57bfce7a541442fd02cd729a1bab17f0 Reviewed-on: https://chromium-review.googlesource.com/301468 Reviewed-by: Geoff Lang <geofflang@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org> Tryjob-Request: Jamie Madill <jmadill@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>

  • util/geometry_utils.h
  • //
    // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    // geometry_utils:
    //   Helper library for generating certain sets of geometry.
    //
    
    #ifndef UTIL_GEOMETRY_UTILS_H
    #define UTIL_GEOMETRY_UTILS_H
    
    #include <cstddef>
    #include <vector>
    #include <GLES2/gl2.h>
    
    #include "Vector.h"
    
    struct SphereGeometry
    {
        std::vector<Vector3> positions;
        std::vector<Vector3> normals;
        std::vector<GLushort> indices;
    };
    
    void CreateSphereGeometry(size_t sliceCount, float radius, SphereGeometry *result);
    
    struct CubeGeometry
    {
        std::vector<Vector3> positions;
        std::vector<Vector3> normals;
        std::vector<Vector2> texcoords;
        std::vector<GLushort> indices;
    };
    
    void GenerateCubeGeometry(float radius, CubeGeometry *result);
    
    #endif  // UTIL_GEOMETRY_UTILS_H