00001 /* 00002 * obj.c -- obj model loader 00003 * last modification: dec. 15, 2005 00004 * 00005 * Copyright (c) 2005 David HENRY 00006 * 00007 * Permission is hereby granted, free of charge, to any person 00008 * obtaining a copy of this software and associated documentation 00009 * files (the "Software"), to deal in the Software without 00010 * restriction, including without limitation the rights to use, 00011 * copy, modify, merge, publish, distribute, sublicense, and/or 00012 * sell copies of the Software, and to permit persons to whom the 00013 * Software is furnished to do so, subject to the following conditions: 00014 * 00015 * The above copyright notice and this permission notice shall be 00016 * included in all copies or substantial portions of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00019 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00021 * NONINFRINGEMENT. 00022 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 00023 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 00024 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 00025 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00026 * 00027 * gcc -Wall -ansi -L/usr/X11R6/lib -lGL -lGLU -lglut obj.c -o obj 00028 */ 00029 00030 #ifndef LOADEROBJ_H 00031 #define LOADEROBJ_H 00032 00033 #include "plugin_loader.h" 00034 00035 00041 class LoaderObj: public PluginLoader { 00042 00043 public: 00044 LoaderObj(); 00045 virtual void run(); 00046 private: 00047 00048 int mallocModel ( MeshNS::SimpleMesh *mdl ); 00049 int firstPass ( FILE *fp, MeshNS::SimpleMesh *mdl ); 00050 int secondPass ( FILE *fp, MeshNS::SimpleMesh *mdl ); 00051 int readOBJModel ( const char *filename, MeshNS::SimpleMesh *mdl ); 00052 00053 }; 00054 00055 00056 00057 00058 #endif