~hikiko/nux/arb-srgba-shader

« back to all changes in this revision

Viewing changes to NuxGraphics/GLSh_DrawFunction.h

  • Committer: Neil Jagdish Patel
  • Date: 2010-09-02 03:28:11 UTC
  • Revision ID: neil.patel@canonical.com-20100902032811-i2m18tfb6pkasnvt
Remove Win EOL chars

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
 
22
22
 
23
 
#ifndef GLSH_DRAWFUNCTION_H
24
 
#define GLSH_DRAWFUNCTION_H
25
 
 
26
 
#include "GLShader.h"
27
 
#include "GLShaderParameter.h"
28
 
#include "NuxCore/Math/Matrix4.h"
29
 
#include "GLDeviceObjects.h"
30
 
 
31
 
NAMESPACE_BEGIN_OGL
32
 
 
33
 
class TemplateQuadBuffer;
34
 
 
35
 
class GLSh_DrawFunction
36
 
{
37
 
public:
38
 
    GLSh_DrawFunction();
39
 
    ~GLSh_DrawFunction();
40
 
 
41
 
    void CacheShader();
42
 
    void SetBackgroundColor(float R, float G, float B, float A);
43
 
    void SetBackgroundColor(Color color);
44
 
    void SetTextureFunction(TRefGL<IOpenGLTexture2D> device_texture);
45
 
    void SetTransformMatrix(const Matrix4& TransformMatrix)
46
 
    {
47
 
        m_TransformMatrix = TransformMatrix;
48
 
    }
49
 
    void Render(int x, int y, int z, int width, int height, int WindowWidth, int WindowHeight);
50
 
    void SetScreenPositionOffset(float x, float y);
51
 
 
52
 
private:
53
 
    float _R, _G, _B, _A;
54
 
    TRefGL<IOpenGLShaderProgram> sprog;
55
 
    TRefGL<IOpenGLAsmShaderProgram> m_AsmProg;
56
 
 
57
 
    float _ScreenOffsetX, _ScreenOffsetY;
58
 
    UINT ViewPortX;
59
 
    UINT ViewPortY;
60
 
    UINT ViewPortWidth;
61
 
    UINT ViewPortHeight;
62
 
    Matrix4 m_TransformMatrix;
63
 
    TRefGL<IOpenGLTexture2D> m_device_texture;
64
 
 
65
 
private:
66
 
    TemplateQuadBuffer* m_QuadBuffer;
67
 
};
68
 
NAMESPACE_END_OGL
69
 
 
70
 
#endif // GLSH_DRAWFUNCTION_H
 
23
#ifndef GLSH_DRAWFUNCTION_H
 
24
#define GLSH_DRAWFUNCTION_H
 
25
 
 
26
#include "GLShader.h"
 
27
#include "GLShaderParameter.h"
 
28
#include "NuxCore/Math/Matrix4.h"
 
29
#include "GLDeviceObjects.h"
 
30
 
 
31
NAMESPACE_BEGIN_OGL
 
32
 
 
33
class TemplateQuadBuffer;
 
34
 
 
35
class GLSh_DrawFunction
 
36
{
 
37
public:
 
38
    GLSh_DrawFunction();
 
39
    ~GLSh_DrawFunction();
 
40
 
 
41
    void CacheShader();
 
42
    void SetBackgroundColor(float R, float G, float B, float A);
 
43
    void SetBackgroundColor(Color color);
 
44
    void SetTextureFunction(TRefGL<IOpenGLTexture2D> device_texture);
 
45
    void SetTransformMatrix(const Matrix4& TransformMatrix)
 
46
    {
 
47
        m_TransformMatrix = TransformMatrix;
 
48
    }
 
49
    void Render(int x, int y, int z, int width, int height, int WindowWidth, int WindowHeight);
 
50
    void SetScreenPositionOffset(float x, float y);
 
51
 
 
52
private:
 
53
    float _R, _G, _B, _A;
 
54
    TRefGL<IOpenGLShaderProgram> sprog;
 
55
    TRefGL<IOpenGLAsmShaderProgram> m_AsmProg;
 
56
 
 
57
    float _ScreenOffsetX, _ScreenOffsetY;
 
58
    UINT ViewPortX;
 
59
    UINT ViewPortY;
 
60
    UINT ViewPortWidth;
 
61
    UINT ViewPortHeight;
 
62
    Matrix4 m_TransformMatrix;
 
63
    TRefGL<IOpenGLTexture2D> m_device_texture;
 
64
 
 
65
private:
 
66
    TemplateQuadBuffer* m_QuadBuffer;
 
67
};
 
68
NAMESPACE_END_OGL
 
69
 
 
70
#endif // GLSH_DRAWFUNCTION_H