blob: f68bad09c6b1b96bc300cc86f41797852cae1f78 [file] [log] [blame]
John Bauman89401822014-05-06 15:04:28 -04001// SwiftShader Software Renderer
2//
3// Copyright(c) 2005-2011 TransGaming Inc.
4//
5// All rights reserved. No part of this software may be copied, distributed, transmitted,
6// transcribed, stored in a retrieval system, translated into any human or computer
7// language by any means, or disclosed to third parties without the explicit written
8// agreement of TransGaming Inc. Without such an agreement, no rights or licenses, express
9// or implied, including but not limited to any patent rights, are granted to you.
10//
11
12#ifndef dx_Surface_hpp
13#define dx_Surface_hpp
14
15#include "Unknown.hpp"
16
17#include "Renderer/Surface.hpp"
18
19#define GL_APICALL
20#include <GLES2/gl2.h>
21
22namespace gl
23{
24 class Image : public Unknown, public sw::Surface
25 {
26 public:
27 Image(sw::Resource *parentTexture, GLsizei width, GLsizei height, GLenum format, GLenum type);
28 Image(sw::Resource *parentTexture, GLsizei width, GLsizei height, sw::Format internalFormat, GLenum format, GLenum type, int multiSampleDepth, bool lockable, bool renderTarget);
29
30 virtual ~Image();
31
32 virtual void *lock(unsigned int left, unsigned int top, sw::Lock lock);
33 virtual unsigned int getPitch();
34 virtual void unlock();
35
36 virtual int getWidth();
37 virtual int getHeight();
38 virtual GLenum getFormat();
39 virtual GLenum getType();
40 virtual sw::Format getInternalFormat();
41 virtual int getMultiSampleDepth();
42
43 static sw::Format selectInternalFormat(GLenum format, GLenum type);
44 static int bytes(sw::Format format);
45
46 private:
47 const GLsizei width;
48 const GLsizei height;
49 const GLenum format;
50 const GLenum type;
51 const sw::Format internalFormat;
52 const int multiSampleDepth;
53 };
54}
55
56#endif // dx_Surface_hpp