00001 /* 00002 Copyright (c) 2008, Luke Benstead. 00003 All rights reserved. 00004 00005 Redistribution and use in source and binary forms, with or without modification, 00006 are permitted provided that the following conditions are met: 00007 00008 * Redistributions of source code must retain the above copyright notice, 00009 this list of conditions and the following disclaimer. 00010 * Redistributions in binary form must reproduce the above copyright notice, 00011 this list of conditions and the following disclaimer in the documentation 00012 and/or other materials provided with the distribution. 00013 00014 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 00015 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00016 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00017 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 00018 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00019 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00020 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 00021 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00022 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00023 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00024 */ 00025 00026 #ifndef C_STACK_H_INCLUDED 00027 #define C_STACK_H_INCLUDED 00028 00029 #include "../mat4.h" 00030 00031 typedef struct km_mat4_stack { 00032 int capacity; //The total item capacity 00033 int item_count; //The number of items 00034 kmMat4* top; 00035 kmMat4* stack; 00036 } km_mat4_stack; 00037 00038 #ifdef __cplusplus 00039 extern "C" { 00040 #endif 00041 00042 void km_mat4_stack_initialize(km_mat4_stack* stack); 00043 void km_mat4_stack_push(km_mat4_stack* stack, const kmMat4* item); 00044 void km_mat4_stack_pop(km_mat4_stack* stack, kmMat4* pOut); 00045 void km_mat4_stack_release(km_mat4_stack* stack); 00046 00047 #ifdef __cplusplus 00048 } 00049 #endif 00050 00051 #endif // C_STACK_H_INCLUDED