overte/shared/src/SharedUtil.h
ZappoMan 8ecc0d53ad Added a utility to VoxelSystem for loading voxels from a local file
Also added a couple shared utility functions for reading command
line options (since that's how you can load a local file at this
point).
2013-03-23 21:59:27 -07:00

37 lines
759 B
C++

//
// SharedUtil.h
// hifi
//
// Created by Stephen Birarda on 2/22/13.
//
//
#ifndef __hifi__SharedUtil__
#define __hifi__SharedUtil__
#include <iostream>
#include <cstdio>
#ifdef _WIN32
#include "Systime.h"
#else
#include <sys/time.h>
#endif
double usecTimestamp(timeval *time);
double usecTimestampNow();
float randFloat();
unsigned char randomColorValue(int minimum);
bool randomBoolean();
void outputBits(unsigned char byte);
int numberOfOnes(unsigned char byte);
bool oneAtBit(unsigned char byte, int bitIndex);
void switchToResourcesIfRequired();
char* getCmdOption(char ** begin, char ** end, const std::string& option);
bool cmdOptionExists(char** begin, char** end, const std::string& option);
#endif /* defined(__hifi__SharedUtil__) */