~ubuntu-branches/ubuntu/trusty/glew/trusty

« back to all changes in this revision

Viewing changes to auto/src/glew_init_tail.c

  • Committer: Bazaar Package Importer
  • Author(s): Joost Yervante Damad
  • Date: 2010-04-10 18:16:21 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20100410181621-179fn0er7sjbccku
Tags: 1.5.3-1
* New upstream release (Closes: #577183)
* reworked mx build support to reflect new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ------------------------------------------------------------------------ */
2
 
 
3
 
const GLubyte* glewGetErrorString (GLenum error)
4
 
{
5
 
  static const GLubyte* _glewErrorString[] =
6
 
  {
7
 
    (const GLubyte*)"No error",
8
 
    (const GLubyte*)"Missing GL version",
9
 
    (const GLubyte*)"GL 1.1 and up are not supported",
10
 
    (const GLubyte*)"GLX 1.2 and up are not supported",
11
 
    (const GLubyte*)"Unknown error"
12
 
  };
13
 
  const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
14
 
  return _glewErrorString[(int)error > max_error ? max_error : (int)error];
15
 
}
16
 
 
17
 
const GLubyte* glewGetString (GLenum name)
18
 
{
19
 
  static const GLubyte* _glewString[] =
20
 
  {
21
 
    (const GLubyte*)NULL,
22
 
    (const GLubyte*)"GLEW_VERSION_STRING",
23
 
    (const GLubyte*)"GLEW_VERSION_MAJOR_STRING",
24
 
    (const GLubyte*)"GLEW_VERSION_MINOR_STRING",
25
 
    (const GLubyte*)"GLEW_VERSION_MICRO_STRING"
26
 
  };
27
 
  const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
28
 
  return _glewString[(int)name > max_string ? 0 : (int)name];
29
 
}
30
 
 
31
 
/* ------------------------------------------------------------------------ */
32
 
 
33
 
GLboolean glewExperimental = GL_FALSE;
34
 
 
35
 
#if !defined(GLEW_MX)
36
 
 
37
 
#if defined(_WIN32)
38
 
extern GLenum wglewContextInit (void);
39
 
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
40
 
extern GLenum glxewContextInit (void);
41
 
#endif /* _WIN32 */
42
 
 
43
 
GLenum glewInit ()
44
 
{
45
 
  GLenum r;
46
 
  if ( (r = glewContextInit()) ) return r;
47
 
#if defined(_WIN32)
48
 
  return wglewContextInit();
49
 
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
50
 
  return glxewContextInit();
51
 
#else
52
 
  return r;
53
 
#endif /* _WIN32 */
54
 
}
55
 
 
56
 
#endif /* !GLEW_MX */
 
1
/* ------------------------------------------------------------------------ */
 
2
 
 
3
const GLubyte* glewGetErrorString (GLenum error)
 
4
{
 
5
  static const GLubyte* _glewErrorString[] =
 
6
  {
 
7
    (const GLubyte*)"No error",
 
8
    (const GLubyte*)"Missing GL version",
 
9
    (const GLubyte*)"GL 1.1 and up are not supported",
 
10
    (const GLubyte*)"GLX 1.2 and up are not supported",
 
11
    (const GLubyte*)"Unknown error"
 
12
  };
 
13
  const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
 
14
  return _glewErrorString[(int)error > max_error ? max_error : (int)error];
 
15
}
 
16
 
 
17
const GLubyte* glewGetString (GLenum name)
 
18
{
 
19
  static const GLubyte* _glewString[] =
 
20
  {
 
21
    (const GLubyte*)NULL,
 
22
    (const GLubyte*)"GLEW_VERSION_STRING",
 
23
    (const GLubyte*)"GLEW_VERSION_MAJOR_STRING",
 
24
    (const GLubyte*)"GLEW_VERSION_MINOR_STRING",
 
25
    (const GLubyte*)"GLEW_VERSION_MICRO_STRING"
 
26
  };
 
27
  const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
 
28
  return _glewString[(int)name > max_string ? 0 : (int)name];
 
29
}
 
30
 
 
31
/* ------------------------------------------------------------------------ */
 
32
 
 
33
GLboolean glewExperimental = GL_FALSE;
 
34
 
 
35
#if !defined(GLEW_MX)
 
36
 
 
37
#if defined(_WIN32)
 
38
extern GLenum wglewContextInit (void);
 
39
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
 
40
extern GLenum glxewContextInit (void);
 
41
#endif /* _WIN32 */
 
42
 
 
43
GLenum glewInit ()
 
44
{
 
45
  GLenum r;
 
46
  if ( (r = glewContextInit()) ) return r;
 
47
#if defined(_WIN32)
 
48
  return wglewContextInit();
 
49
#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */
 
50
  return glxewContextInit();
 
51
#else
 
52
  return r;
 
53
#endif /* _WIN32 */
 
54
}
 
55
 
 
56
#endif /* !GLEW_MX */