-
Notifications
You must be signed in to change notification settings - Fork 400
/
ProgramGPU.h
59 lines (53 loc) · 1.92 KB
/
ProgramGPU.h
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
54
55
56
57
58
////////////////////////////////////////////////////////////////////////////
// File: ProgramGPU.h
// Author: Changchang Wu
// Description : Based class for GPU programs
// ProgramGPU: base class of ProgramGLSL
// FilterProgram: base class of FilterGLSL, FilterPKSL
//
// Copyright (c) 2007 University of North Carolina at Chapel Hill
// All Rights Reserved
//
// Permission to use, copy, modify and distribute this software and its
// documentation for educational, research and non-profit purposes, without
// fee, and without a written agreement is hereby granted, provided that the
// above copyright notice and the following paragraph appear in all copies.
//
// The University of North Carolina at Chapel Hill make no representations
// about the suitability of this software for any purpose. It is provided
// 'as is' without express or implied warranty.
//
// Please send BUG REPORTS to ccwu@cs.unc.edu
//
////////////////////////////////////////////////////////////////////////////
#ifndef _PROGRAM_GPU_H
#define _PROGRAM_GPU_H
////////////////////////////////////////////////////////////////////////////
//class ProgramGPU
//description: pure virtual class
// provides a common interface for shader programs
///////////////////////////////////////////////////////////////////////////
class ProgramGPU
{
public:
//use a gpu program
virtual int UseProgram() = 0;
virtual void* GetProgramID() = 0;
//not used
virtual ~ProgramGPU(){};
};
///////////////////////////////////////////////////////////////////////////
//class FilterProgram
///////////////////////////////////////////////////////////////////////////
class FilterProgram
{
public:
ProgramGPU* s_shader_h;
ProgramGPU* s_shader_v;
int _size;
int _id;
public:
FilterProgram() { s_shader_h = s_shader_v = NULL; _size = _id = 0; }
virtual ~FilterProgram() { if(s_shader_h) delete s_shader_h; if(s_shader_v) delete s_shader_v;}
};
#endif