1 /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; -*- */ 2 /* ***** BEGIN LICENSE BLOCK ***** 3 * This file is part of openfx-supportext <https://github.com/devernay/openfx-supportext>, 4 * Copyright (C) 2013-2018 INRIA 5 * 6 * openfx-supportext is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * openfx-supportext is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with openfx-supportext. If not, see <http://www.gnu.org/licenses/gpl-2.0.html> 18 * ***** END LICENSE BLOCK ***** */ 19 20 /* 21 * Small utility to draw text using OpenGL. 22 * 23 * This code is based on the free glut source code. 24 * 25 * Copyright (c) 1999-2000 Pawel W. Olszta. All Rights Reserved. 26 * Written by Pawel W. Olszta, <olszta@sourceforge.net> 27 * Creation date: Thu Dec 2 1999 28 * 29 * Permission is hereby granted, free of charge, to any person obtaining a 30 * copy of this software and associated documentation files (the "Software"), 31 * to deal in the Software without restriction, including without limitation 32 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 33 * and/or sell copies of the Software, and to permit persons to whom the 34 * Software is furnished to do so, subject to the following conditions: 35 * 36 * The above copyright notice and this permission notice shall be included 37 * in all copies or substantial portions of the Software. 38 * 39 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 40 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 41 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 42 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 43 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 44 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 45 */ 46 #ifndef openfx_supportext_ofxsOGLFontUtils_h 47 #define openfx_supportext_ofxsOGLFontUtils_h 48 49 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) 50 #include <windows.h> 51 #endif 52 #ifdef __APPLE__ 53 #include <OpenGL/gl.h> 54 #else 55 #ifdef _WIN32 56 #define WIN32_LEAN_AND_MEAN 57 #ifndef NOMINMAX 58 #define NOMINMAX 59 #endif 60 #include <windows.h> 61 #endif 62 63 #include <GL/gl.h> 64 #endif 65 66 namespace OFX { 67 typedef struct tagSFG_Font SFG_Font; 68 struct tagSFG_Font 69 { 70 const char* Name; /* The source font name */ 71 int Quantity; /* Number of chars in font */ 72 int Height; /* Height of the characters */ 73 const GLubyte** Characters; /* The characters mapping */ 74 float xorig, yorig; /* Relative origin of the character */ 75 }; 76 77 extern const SFG_Font fgFontFixed8x13; 78 extern const SFG_Font fgFontFixed9x15; 79 extern const SFG_Font fgFontHelvetica10; 80 extern const SFG_Font fgFontHelvetica12; 81 extern const SFG_Font fgFontHelvetica18; 82 extern const SFG_Font fgFontTimesRoman10; 83 extern const SFG_Font fgFontTimesRoman24; 84 } // OFX 85 #endif /* defined(openfx_supportext_ofxsOGLFontUtils_h) */ 86