Hash :
ad60e8ee
Author :
Date :
2015-09-22T12:40:31
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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
//
// 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