2 // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
7 // Display.h: Defines the egl::Display class, representing the abstract
8 // display on which graphics are drawn. Implements EGLDisplay.
9 // [EGL 1.4] section 2.1.2 page 3.
11 #ifndef INCLUDE_DISPLAY_H_
12 #define INCLUDE_DISPLAY_H_
14 #ifndef WIN32_LEAN_AND_MEAN
15 #define WIN32_LEAN_AND_MEAN
22 #include "libGLESv2/Context.h"
24 #include "libEGL/Config.h"
25 #include "libEGL/Surface.h"
32 Display(HDC deviceContext);
39 virtual void startScene();
40 virtual void endScene();
42 bool getConfigs(EGLConfig *configs, const EGLint *attribList, EGLint configSize, EGLint *numConfig);
43 bool getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value);
45 EGLSurface createWindowSurface(HWND window, EGLConfig config, const EGLint *attribList);
46 EGLSurface createOffscreenSurface(EGLConfig config, HANDLE shareHandle, const EGLint *attribList);
47 EGLContext createContext(EGLConfig configHandle, const gl::Context *shareContext);
49 void destroySurface(egl::Surface *surface);
50 void destroyContext(gl::Context *context);
52 bool isInitialized() const;
53 bool isValidConfig(EGLConfig config);
54 bool isValidContext(gl::Context *context);
55 bool isValidSurface(egl::Surface *surface);
56 bool hasExistingWindowSurface(HWND window);
58 EGLint getMinSwapInterval();
59 EGLint getMaxSwapInterval();
61 virtual IDirect3DDevice9 *getDevice();
62 virtual D3DCAPS9 getDeviceCaps();
63 virtual D3DADAPTER_IDENTIFIER9 *getAdapterIdentifier();
65 virtual void getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray);
66 virtual bool getCompressedTextureSupport();
67 virtual bool getEventQuerySupport();
68 virtual bool getFloatTextureSupport(bool *filtering, bool *renderable);
69 virtual bool getHalfFloatTextureSupport(bool *filtering, bool *renderable);
70 virtual bool getLuminanceTextureSupport();
71 virtual bool getLuminanceAlphaTextureSupport();
72 virtual bool getVertexTextureSupport() const;
73 virtual bool getNonPower2TextureSupport() const;
74 virtual D3DPOOL getBufferPool(DWORD usage) const;
76 bool isD3d9ExDevice() { return mD3d9Ex != NULL; }
77 const char *getExtensionString() const;
80 DISALLOW_COPY_AND_ASSIGN(Display);
82 D3DPRESENT_PARAMETERS getDefaultPresentParameters();
89 D3DDEVTYPE mDeviceType;
90 IDirect3D9 *mD3d9; // Always valid after successful initialization.
91 IDirect3D9Ex *mD3d9Ex; // Might be null if D3D9Ex is not supported.
92 IDirect3DDevice9 *mDevice;
93 IDirect3DDevice9Ex *mDeviceEx; // Might be null if D3D9Ex is not supported.
95 D3DADAPTER_IDENTIFIER9 mAdapterIdentifier;
99 EGLint mMaxSwapInterval;
100 EGLint mMinSwapInterval;
102 typedef std::set<Surface*> SurfaceSet;
103 SurfaceSet mSurfaceSet;
105 ConfigSet mConfigSet;
107 typedef std::set<gl::Context*> ContextSet;
108 ContextSet mContextSet;
113 void initExtensionString();
114 std::string mExtensionString;
118 #endif // INCLUDE_DISPLAY_H_