source: trunk/packages/vizservers/nanovis/global.h @ 2849

Last change on this file since 2849 was 2831, checked in by ldelgass, 12 years ago

Refactor texture classes, misc. cleanups, cut down on header pollution -- still
need to fix header deps in Makefile.in

  • Property svn:eol-style set to native
File size: 1.5 KB
Line 
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
21inline void
22draw_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
33inline void
34system_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
43extern CGprogram LoadCgSourceProgram(CGcontext context, const char *filename,
44                                     CGprofile profile, const char *entryPoint);
45
46#endif
Note: See TracBrowser for help on using the repository browser.