summaryrefslogtreecommitdiff
path: root/cad/plugins/QuteMol/qutemol/src/MyCanvas.h
blob: 7eced9b4d3d6694fce2d285e48b6f15f9fc88df3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

#include <wx/log.h>


class MyCanvas{
public:
  
  
  bool ratio2x1;
  
  typedef enum{ COLOR, DEPTH, COLOR_AND_DEPTH } Kind;
  Kind kind;
  
  bool SetAsOutput();
  bool SetAsTexture();
  
  bool Test(){return SetAsOutput();}
  
  MyCanvas(Kind k, int size);
  MyCanvas(Kind k);
    
  void SetRes( int res );
  void SetResPow2( int pow );
  
  int GetSoftRes();
  int GetHardRes();
  
  int GetResPow2( ) {return currentRes; }
  
  int GetVideoSize( ) {
    return videoSize;
  }
  
  void SetSameRes( const MyCanvas &c );
  
  void RedirectToVideo();
  void RedirectToMemory();
  void SetVideoSize(int v); // when redirectig to video
  
private:
  int currentRes; // just an index
  enum {MAX_RES=15};
  unsigned int frameID[MAX_RES];
  unsigned int textureID[MAX_RES];
  bool InitRes();
  bool onVideo;
  int videoSize;
  int softRes; // subset image, not a power of 2
};

extern MyCanvas mainCanvas, haloCanvas, moltextureCanvas, shadowmapCanvas, shadowAOCanvas;