~ubuntu-branches/ubuntu/lucid/glew/lucid-201002122355

« back to all changes in this revision

Viewing changes to auto/src/glew_init_wgl.c

  • Committer: Bazaar Package Importer
  • Author(s): Muharem Hrnjadovic
  • Date: 2009-06-04 12:12:40 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090604121240-e0rh5kfvft8wh2b0
Tags: 1.5.1-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Build shared libraries with CC, not LD.
  - The debian Makefile had trailing '^M' characters; once sanitized
    the diff between the debian/ubuntu Makefile looks as follows:
    http://pastebin.ca/1447378

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ------------------------------------------------------------------------- */
2
 
 
3
 
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
4
 
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
5
 
 
6
 
GLboolean wglewGetExtension (const char* name)
7
 
{    
8
 
  GLubyte* p;
9
 
  GLubyte* end;
10
 
  GLuint len = _glewStrLen((const GLubyte*)name);
11
 
  if (_wglewGetExtensionsStringARB == NULL)
12
 
    if (_wglewGetExtensionsStringEXT == NULL)
13
 
      return GL_FALSE;
14
 
    else
15
 
      p = (GLubyte*)_wglewGetExtensionsStringEXT();
16
 
  else
17
 
    p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
18
 
  if (0 == p) return GL_FALSE;
19
 
  end = p + _glewStrLen(p);
20
 
  while (p < end)
21
 
  {
22
 
    GLuint n = _glewStrCLen(p, ' ');
23
 
    if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
24
 
    p += n+1;
25
 
  }
26
 
  return GL_FALSE;
27
 
}
28
 
 
29
 
GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
30
 
{
31
 
  GLboolean crippled;
32
 
  /* find wgl extension string query functions */
33
 
  _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
34
 
  _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
35
 
  /* initialize extensions */
36
 
  crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
 
1
/* ------------------------------------------------------------------------- */
 
2
 
 
3
static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
 
4
static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
 
5
 
 
6
GLboolean wglewGetExtension (const char* name)
 
7
{    
 
8
  GLubyte* p;
 
9
  GLubyte* end;
 
10
  GLuint len = _glewStrLen((const GLubyte*)name);
 
11
  if (_wglewGetExtensionsStringARB == NULL)
 
12
    if (_wglewGetExtensionsStringEXT == NULL)
 
13
      return GL_FALSE;
 
14
    else
 
15
      p = (GLubyte*)_wglewGetExtensionsStringEXT();
 
16
  else
 
17
    p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
 
18
  if (0 == p) return GL_FALSE;
 
19
  end = p + _glewStrLen(p);
 
20
  while (p < end)
 
21
  {
 
22
    GLuint n = _glewStrCLen(p, ' ');
 
23
    if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
 
24
    p += n+1;
 
25
  }
 
26
  return GL_FALSE;
 
27
}
 
28
 
 
29
GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
 
30
{
 
31
  GLboolean crippled;
 
32
  /* find wgl extension string query functions */
 
33
  _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
 
34
  _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
 
35
  /* initialize extensions */
 
36
  crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;