summaryrefslogtreecommitdiffstats
path: root/src/util/check_error.c (plain)
blob: c47ca438d106fa1dc980adbb223d6ddc2db90f02
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
#include <GL/glut.h>
#include <error.h>
#include <errno.h>
#include <stdlib.h>
#include "sqlinfoprint.h"
extern struct sqlca sqlca;

void
check_error (const char *filename, const unsigned int linenum)
{

  /*
   * Check for an error from the OpenGL API.
   */
  GLenum errCode = glGetError ();
  if (errCode != GL_NO_ERROR)
    {
      const GLubyte *errString = gluErrorString (errCode);
      error_at_line (EXIT_FAILURE, errno, filename, linenum,
		     "OpenGL Error %s", errString);
    }

  /*
   * Check for an error from the Database API.
   */
  if (sqlinfoprint ("DB Error", &sqlca, filename, linenum) == 1)
    exit (EXIT_FAILURE);

  return;
}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.