Path: blob/main_old/samples/sample_util/SampleApplication.h
1695 views
//1// Copyright 2014 The ANGLE Project Authors. All rights reserved.2// Use of this source code is governed by a BSD-style license that can be3// found in the LICENSE file.4//56#ifndef SAMPLE_UTIL_SAMPLE_APPLICATION_H7#define SAMPLE_UTIL_SAMPLE_APPLICATION_H89#include <stdint.h>10#include <list>11#include <memory>12#include <string>1314#include "common/system_utils.h"15#include "util/EGLPlatformParameters.h"16#include "util/OSWindow.h"17#include "util/Timer.h"18#include "util/egl_loader_autogen.h"1920class EGLWindow;21class GLWindowBase;2223namespace angle24{25class Library;26} // namespace angle2728class SampleApplication29{30public:31SampleApplication(std::string name,32int argc,33char **argv,34EGLint glesMajorVersion = 2,35EGLint glesMinorVersion = 0,36uint32_t width = 1280,37uint32_t height = 720);38virtual ~SampleApplication();3940virtual bool initialize();41virtual void destroy();4243virtual void step(float dt, double totalTime);44virtual void draw();4546virtual void swap();4748virtual void onKeyUp(const Event::KeyEvent &keyEvent);49virtual void onKeyDown(const Event::KeyEvent &keyEvent);5051OSWindow *getWindow() const;52EGLConfig getConfig() const;53EGLDisplay getDisplay() const;54EGLSurface getSurface() const;55EGLContext getContext() const;5657int run();58void exit();5960private:61bool popEvent(Event *event);6263std::string mName;64uint32_t mWidth;65uint32_t mHeight;66bool mRunning;6768Timer mTimer;69uint32_t mFrameCount;70GLWindowBase *mGLWindow;71EGLWindow *mEGLWindow;72OSWindow *mOSWindow;73angle::GLESDriverType mDriverType;7475EGLPlatformParameters mPlatformParams;7677// Handle to the entry point binding library.78std::unique_ptr<angle::Library> mEntryPointsLib;79};8081#endif // SAMPLE_UTIL_SAMPLE_APPLICATION_H828384