Commit db39e7f5 by Corentin Wallez

Rename path_utils to system_utils

For inclusion of Sleep BUG=angleproject:892 Change-Id: I1a9491102e9943d945eef0ba372a6779c30cd311 Reviewed-on: https://chromium-review.googlesource.com/273131Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent 3d5cb774
......@@ -14,9 +14,10 @@
// http://www.opengles-book.com
#include "SampleApplication.h"
#include "shader_utils.h"
#include "system_utils.h"
#include "tga_utils.h"
#include "path_utils.h"
class MultiTextureSample : public SampleApplication
{
......@@ -83,8 +84,8 @@ class MultiTextureSample : public SampleApplication
mLightMapLoc = glGetUniformLocation(mProgram, "s_lightMap");
// Load the textures
mBaseMapTexID = loadTexture(GetExecutableDirectory() + "/basemap.tga");
mLightMapTexID = loadTexture(GetExecutableDirectory() + "/lightmap.tga");
mBaseMapTexID = loadTexture(angle::GetExecutableDirectory() + "/basemap.tga");
mLightMapTexID = loadTexture(angle::GetExecutableDirectory() + "/lightmap.tga");
if (mBaseMapTexID == 0 || mLightMapTexID == 0)
{
return false;
......
......@@ -15,7 +15,7 @@
#include "SampleApplication.h"
#include "shader_utils.h"
#include "path_utils.h"
#include "system_utils.h"
#include "texture_utils.h"
#include <cstring>
......@@ -49,15 +49,15 @@ class MultipleDrawBuffersSample : public SampleApplication
return false;
}
mMRTProgram = CompileProgramFromFiles(GetExecutableDirectory() + "/multiple_draw_buffers_vs.glsl",
GetExecutableDirectory() + "/multiple_draw_buffers_fs.glsl");
mMRTProgram = CompileProgramFromFiles(angle::GetExecutableDirectory() + "/multiple_draw_buffers_vs.glsl",
angle::GetExecutableDirectory() + "/multiple_draw_buffers_fs.glsl");
if (!mMRTProgram)
{
return false;
}
mCopyProgram = CompileProgramFromFiles(GetExecutableDirectory() + "/multiple_draw_buffers_vs.glsl",
GetExecutableDirectory() + "/multiple_draw_buffers_copy_fs.glsl");
mCopyProgram = CompileProgramFromFiles(angle::GetExecutableDirectory() + "/multiple_draw_buffers_vs.glsl",
angle::GetExecutableDirectory() + "/multiple_draw_buffers_copy_fs.glsl");
if (!mCopyProgram)
{
return false;
......
......@@ -17,8 +17,8 @@
#include "Vector.h"
#include "shader_utils.h"
#include "random_utils.h"
#include "system_utils.h"
#include "tga_utils.h"
#include "path_utils.h"
#define _USE_MATH_DEFINES
#include <math.h>
......@@ -114,7 +114,7 @@ class ParticleSystemSample : public SampleApplication
mParticleTime = 1.0f;
TGAImage img;
if (!LoadTGAImageFromFile(GetExecutableDirectory() + "/smoke.tga", &img))
if (!LoadTGAImageFromFile(angle::GetExecutableDirectory() + "/smoke.tga", &img))
{
return false;
}
......
......@@ -4,14 +4,17 @@
// found in the LICENSE file.
//
// Linux_path_utils.cpp: Implementation of OS-specific path functions for Linux
// Linux_system_utils.cpp: Implementation of OS-specific functions for Linux
#include "path_utils.h"
#include "system_utils.h"
#include <sys/stat.h>
#include <unistd.h>
#include <array>
namespace angle
{
std::string GetExecutablePath()
{
// We cannot use lstat to get the size of /proc/self/exe as it always returns 0
......@@ -34,3 +37,5 @@ std::string GetExecutableDirectory()
size_t lastPathSepLoc = executablePath.find_last_of("/");
return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : "";
}
} // namespace angle
......@@ -4,12 +4,19 @@
// found in the LICENSE file.
//
// system_utils.h: declaration of OS-specific utility functions
#ifndef SAMPLE_UTIL_PATH_UTILS_H
#define SAMPLE_UTIL_PATH_UTILS_H
#include <string>
namespace angle
{
std::string GetExecutablePath();
std::string GetExecutableDirectory();
} // namespace angle
#endif // SAMPLE_UTIL_PATH_UTILS_H
......@@ -10,21 +10,21 @@
'com_utils.h',
'keyboard.h',
'mouse.h',
'path_utils.h',
'random_utils.cpp',
'random_utils.h',
'shader_utils.cpp',
'shader_utils.h',
'system_utils.h',
'Event.h',
'EGLWindow.cpp',
'EGLWindow.h',
'Event.h',
'OSWindow.cpp',
'OSWindow.h',
'Timer.h',
],
'util_win32_sources':
[
'win32/Win32_path_utils.cpp',
'win32/Win32_system_utils.cpp',
'win32/Win32Timer.cpp',
'win32/Win32Timer.h',
'win32/Win32Window.cpp',
......@@ -32,7 +32,7 @@
],
'util_linux_sources':
[
'linux/Linux_path_utils.cpp',
'linux/Linux_system_utils.cpp',
'linux/LinuxTimer.cpp',
'linux/LinuxTimer.h',
'x11/X11Window.cpp',
......
......@@ -4,11 +4,15 @@
// found in the LICENSE file.
//
// Win32_path_utils.cpp: Implementation of OS-specific path functions for Windows
// Win32_system_utils.cpp: Implementation of OS-specific functions for Windows
#include "system_utils.h"
#include "path_utils.h"
#include <array>
#include <windows.h>
#include <array>
namespace angle
{
std::string GetExecutablePath()
{
......@@ -23,3 +27,5 @@ std::string GetExecutableDirectory()
size_t lastPathSepLoc = executablePath.find_last_of("\\/");
return (lastPathSepLoc != std::string::npos) ? executablePath.substr(0, lastPathSepLoc) : "";
}
} // namespace angle
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment