/
kiss_graphics.h
69 lines (53 loc) · 2.35 KB
/
kiss_graphics.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/**************************************************************************
* Copyright 2007,2008,2009 KISS Institute for Practical Robotics *
* *
* This file is part of KISS (Kipr's Instructional Software System). *
* *
* KISS is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* KISS is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with KISS. Check the LICENSE file in the project root. *
* If not, see <http://www.gnu.org/licenses/>. *
**************************************************************************/
#ifndef __KISS_GRAPHICS_H__
#define __KISS_GRAPHICS_H__
#include <GL/GLee.h>
#include <GL/glfw.h>
#include <stdint.h>
#ifndef GL_TEXTURE_RECTANGLE_EXT
#define GL_TEXTURE_RECTANGLE_EXT GL_TEXTURE_RECTANGLE_NV
#endif
struct graphics_info {
int width, height;
int texture_target;
int texture_wrap;
int texture_format;
int texture_type;
unsigned char *data;
int buffer_width;
int buffer_height;
float texture_width;
float texture_height;
short **edge_buffer;
short *edge_count;
GLuint texture;
GLFWmutex mutex;
};
void kiss_graphics_open_window(int width, int height);
void kiss_graphics_close_window();
void kiss_graphics_update();
void kiss_graphics_create_buffer();
void kiss_graphics_destroy_buffer();
void kiss_graphics_setup_gl();
void kiss_graphics_lock();
void kiss_graphics_unlock();
extern volatile struct graphics_info kiss_g_graphics_info;
#endif