Files
godot-angle-static/util/random_utils.cpp
Jamie Madill ea0e873313 Add a point sprite benchmark.
This benchmark will attempt to reproduce the slowdown we see
in D3D11 on the turbulenz GPU particles demo.

BUG=angle:705

Change-Id: I9c4c2f09d4282feae30f448fd374cdbb6bceae9b
Reviewed-on: https://chromium-review.googlesource.com/216467
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
2014-09-25 18:40:48 +00:00

23 lines
547 B
C++

//
// 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.
//
#include "random_utils.h"
#include <time.h>
#include <cstdlib>
float RandomBetween(float min, float max)
{
static bool randInitialized = false;
if (!randInitialized)
{
srand(time(NULL));
randInitialized = true;
}
const size_t divisor = 10000;
return min + ((rand() % divisor) / static_cast<float>(divisor)) * (max - min);
}