File: 01_context.t

package info (click to toggle)
libopengl-modern-perl 0.0401-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,592 kB
  • sloc: perl: 82,853; ansic: 47,600; makefile: 3
file content (21 lines) | stat: -rw-r--r-- 571 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use warnings;
use Test::More;
use OpenGL::Modern qw(
  :glewfunctions
  glGetString
  GLEW_OK GL_VERSION GL_TRUE GL_FALSE
);

my $gCC_status = glewCreateContext(); # returns GL_TRUE or GL_FALSE
ok $gCC_status == GL_TRUE || $gCC_status == GL_FALSE, "glewCreateContext";

if ($gCC_status == GLEW_OK) {
  my $gI_status = done_glewInit() ? GLEW_OK() : glewInit();                           # returns GLEW_OK or ???
  is $gI_status, GLEW_OK(), "glewInit";
  if ($gI_status == GLEW_OK()) {
    isnt '', glGetString( GL_VERSION ), 'GL_VERSION';
  }
}

done_testing;