1/* $Id$ 2 3 plOpenGL - SWI-Prolog OpenGL Bindings 4 5 Author: Jan Tatham 6 E-Mail: jan@sebity.com 7 WWW: http://www.sebity.com 8 Copyright (C): 2012-2013, Jan Tatham. 9 10 This library is free software; you can redistribute it and/or 11 modify it under the terms of the GNU Lesser General Public 12 License as published by the Free Software Foundation; either 13 version 2.1 of the License, or (at your option) any later version. 14 15 This library is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 Lesser General Public License for more details. 19 20 You should have received a copy of the GNU Lesser General Public 21 License along with this library; if not, write to the Free Software 22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 23*/ 24 25:- module(plOpenGL, 26 [ 27 loadGLTextures/4, 28 sleep/1, 29 size/2 30]). 31 32 33 34%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 35% Select the Library that you need by commenting out the library % 36% that you do not need, and uncommenting the one you do. % 37%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 38 39:- use_module(library(plGL_defs)). 40:- use_module(library(plGLU_defs)). 41:- use_module(library(plGLUT_defs)). 42:- use_module(library(plGL)). 43:- use_module(library(plGLU)). 44:- use_module(library(plGLUT)). 45:- use_module(library(plMisc)). 46:- use_module(library(general_defs)). 47 48 49 50%%%%%%%%%%%%%% 51% OLD LOADER % 52%%%%%%%%%%%%%% 53% Windows Library 54%:-load_foreign_library('plOpenGL.dll'). 55 56% Mac/Linux Library 57%:-load_foreign_library('plOpenGL.so'). 58 59%:-['plGL_defs.pl'],['plGLU_defs.pl'],['plGLUT_defs.pl']. 60%:-['plGL.pl'],['plGLU.pl'],['plGLUT.pl']. 61%:-['plMisc.pl']. 62%:-['general_defs.pl'].
68loadGLTextures(Filename,Width,Height,Data):-
69 c_loadGLTextures(Filename,Width,Height,Data).
73sleep(X):- 74 X1 = X, 75 c_sleep(X1). 76 77size([],0). 78size([_|T],N) :- size(T,N1), N is N1+1