Oxygine  1
2g game engine
Texture.h
1 #pragma once
2 #include "oxygine-include.h"
3 #include "ref_counter.h"
4 #include "Object.h"
5 #include <vector>
6 #include "math/Rect.h"
7 #include "ImageData.h"
8 
9 namespace oxygine
10 {
11  DECLARE_SMART(Texture, spTexture);
12 
13  inline unsigned int nextPOT(unsigned int v)
14  {
15  v = v - 1;
16  v = v | (v >> 1);
17  v = v | (v >> 2);
18  v = v | (v >> 4);
19  v = v | (v >> 8);
20  v = v | (v >> 16);
21  return v + 1;
22  }
23 
24  class Texture : public Object
25  {
26  public:
27  enum
28  {
29  lock_read = 0x1,
30  lock_write = 0x2,
31  lock_write_on_apply = 0x4,
32  };
33 
34  typedef int lock_flags;
35 
36  virtual int getWidth() const = 0;
37  virtual int getHeight() const = 0;
38  virtual TextureFormat getFormat() const = 0;
39 
40  virtual ImageData lock(lock_flags, const Rect* src) = 0;
41  virtual void unlock() = 0;
42  virtual void updateRegion(int x, int y, const ImageData& data) = 0;
43  virtual void apply(const Rect* rect = 0) = 0;
44  };
45 }
Definition: Texture.h:24
Definition: ImageData.h:54
–oxgl-end–!
Definition: Actor.h:14
Definition: Object.h:83