Add a util project to share between samples and tests.
This code shares the Window and EGL logic between the two
projects.
BUG=angle:730
Change-Id: I8940371226a8f7b02579c332f51679c4a5d0e2a5
Reviewed-on: https://chromium-review.googlesource.com/212799
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/samples/angle/sample_util/SampleApplication.h b/samples/angle/sample_util/SampleApplication.h
index f928643..69ef277 100644
--- a/samples/angle/sample_util/SampleApplication.h
+++ b/samples/angle/sample_util/SampleApplication.h
@@ -7,16 +7,10 @@
#ifndef SAMPLE_UTIL_SAMPLE_APPLICATION_H
#define SAMPLE_UTIL_SAMPLE_APPLICATION_H
-#define GL_GLEXT_PROTOTYPES
-
-#include <GLES3/gl3.h>
-#include <GLES3/gl3ext.h>
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include "Window.h"
+#include "OSWindow.h"
#include "Timer.h"
#include <string>
@@ -24,6 +18,8 @@
#include <cstdint>
#include <memory>
+class EGLWindow;
+
class SampleApplication
{
public:
@@ -39,7 +35,7 @@
virtual void swap();
- Window *getWindow() const;
+ OSWindow *getWindow() const;
EGLConfig getConfig() const;
EGLDisplay getDisplay() const;
EGLSurface getSurface() const;
@@ -51,24 +47,11 @@
void exit();
private:
- bool initializeGL();
- void destroyGL();
-
- EGLConfig mConfig;
- EGLDisplay mDisplay;
- EGLSurface mSurface;
- EGLContext mContext;
-
- GLuint mClientVersion;
- EGLint mRequestedRenderer;
- size_t mWidth;
- size_t mHeight;
std::string mName;
-
bool mRunning;
std::unique_ptr<Timer> mTimer;
- std::unique_ptr<Window> mWindow;
+ std::unique_ptr<EGLWindow> mEGLWindow;
};
#endif // SAMPLE_UTIL_SAMPLE_APPLICATION_H