1 | /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ |
---|
2 | /* |
---|
3 | * ====================================================================== |
---|
4 | * AUTHOR: Wei Qiao <qiaow@purdue.edu> |
---|
5 | * Purdue Rendering and Perceptualization Lab (PURPL) |
---|
6 | * |
---|
7 | * Copyright (c) 2004-2006 Purdue Research Foundation |
---|
8 | * |
---|
9 | * See the file "license.terms" for information on usage and |
---|
10 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
11 | * ====================================================================== |
---|
12 | */ |
---|
13 | #ifndef GLOBAL_H |
---|
14 | #define GLOBAL_H |
---|
15 | |
---|
16 | #include <GL/glew.h> |
---|
17 | #include <Cg/cgGL.h> |
---|
18 | |
---|
19 | #include "Trace.h" |
---|
20 | |
---|
21 | inline void |
---|
22 | draw_quad(int w, int h, int tw, int th) |
---|
23 | { |
---|
24 | glBegin(GL_QUADS); |
---|
25 | glTexCoord2f(0, 0); glVertex2f(0, 0); |
---|
26 | glTexCoord2f((float)tw, 0); glVertex2f((float)w, 0); |
---|
27 | glTexCoord2f((float)tw, (float)th); glVertex2f((float)w, (float) h); |
---|
28 | glTexCoord2f(0, (float)th); glVertex2f(0, (float) h); |
---|
29 | glEnd(); |
---|
30 | } |
---|
31 | |
---|
32 | //query opengl information |
---|
33 | inline void |
---|
34 | system_info() |
---|
35 | { |
---|
36 | TRACE("-----------------------------------------------------------\n"); |
---|
37 | TRACE("OpenGL driver: %s %s\n", glGetString(GL_VENDOR), |
---|
38 | glGetString(GL_VERSION)); |
---|
39 | TRACE("Graphics hardware: %s\n", glGetString(GL_RENDERER)); |
---|
40 | TRACE("-----------------------------------------------------------\n"); |
---|
41 | } |
---|
42 | |
---|
43 | extern CGprogram LoadCgSourceProgram(CGcontext context, const char *filename, |
---|
44 | CGprofile profile, const char *entryPoint); |
---|
45 | |
---|
46 | #endif |
---|