blob: 8caeadf5dc7df57256532f1bba694892c199031f [file] [log] [blame]
José Fonseca93f0e3f2011-10-09 16:16:18 +01001/**************************************************************************
2 *
3 * Copyright 2011 Jose Fonseca
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 * THE SOFTWARE.
23 *
24 **************************************************************************/
25
26
José Fonsecad1c301f2012-10-18 15:22:41 +010027#include <assert.h>
28
José Fonseca3e899d72013-10-29 14:40:57 +000029#include <iostream>
30
José Fonsecad1c301f2012-10-18 15:22:41 +010031#include "glproc.hpp"
José Fonseca93f0e3f2011-10-09 16:16:18 +010032#include "glws.hpp"
33
34
35namespace glws {
36
37
José Fonseca93f0e3f2011-10-09 16:16:18 +010038bool
39checkExtension(const char *extName, const char *extString)
40{
José Fonsecad1c301f2012-10-18 15:22:41 +010041 assert(extName);
José Fonsecaa69cd192014-05-28 18:29:33 +010042
43 if (!extString) {
44 return false;
45 }
José Fonsecad1c301f2012-10-18 15:22:41 +010046
47 const char *p = extString;
48 const char *q = extName;
49 char c;
50 do {
51 c = *p++;
52 if (c == '\0' || c == ' ') {
53 if (q && *q == '\0') {
54 return true;
55 } else {
56 q = extName;
57 }
58 } else {
59 if (q && *q == c) {
60 ++q;
61 } else {
62 q = 0;
63 }
64 }
65 } while (c);
66 return false;
67}
68
69
José Fonseca3e899d72013-10-29 14:40:57 +000070void
71Drawable::copySubBuffer(int x, int y, int width, int height) {
72 std::cerr << "warning: copySubBuffer not yet implemented\n";
73}
74
75
Jose Fonsecac87689f2015-06-27 12:49:02 +010076void
77Context::initialize(void)
78{
79 assert(!initialized);
José Fonsecad1c301f2012-10-18 15:22:41 +010080
Jose Fonsecac87689f2015-06-27 12:49:02 +010081 extensions.getCurrentContextExtensions(profile);
82
83 initialized = true;
José Fonseca93f0e3f2011-10-09 16:16:18 +010084}
85
86
87} /* namespace glws */