1 /**************************************************************************
3 * Copyright 2013-2014 RAD Game Tools and Valve Software
4 * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 **************************************************************************/
28 #include "vogl_core.h"
30 #include "vogl_dynamic_stream.h"
31 #include "vogl_buffer_stream.h"
32 #include "vogl_ryg_dxt.hpp"
33 #include "vogl_pixel_format.h"
37 class vogl_global_initializer
40 vogl_global_initializer()
42 vogl_threading_init();
44 vogl_enable_fail_exceptions(true);
50 vogl_global_initializer g_vogl_initializer;
55 // TODO: Move or delete these straggler funcs, they are artifacts from when voglcore was crnlib
57 const char *vogl_get_format_string(vogl_format fmt)
59 return pixel_format_helpers::get_vogl_format_string(fmt);
62 const char *vogl_get_file_type_ext(vogl_file_type file_type)
76 const char *vogl_get_mip_mode_desc(vogl_mip_mode m)
80 case cCRNMipModeUseSourceOrGenerateMips:
81 return "Use source/generate if none";
82 case cCRNMipModeUseSourceMips:
83 return "Only use source MIP maps (if any)";
84 case cCRNMipModeGenerateMips:
85 return "Always generate new MIP maps";
86 case cCRNMipModeNoMips:
94 const char *vogl_get_mip_mode_name(vogl_mip_mode m)
98 case cCRNMipModeUseSourceOrGenerateMips:
99 return "UseSourceOrGenerate";
100 case cCRNMipModeUseSourceMips:
102 case cCRNMipModeGenerateMips:
104 case cCRNMipModeNoMips:
112 const char *vogl_get_mip_filter_name(vogl_mip_filter f)
116 case cCRNMipFilterBox:
118 case cCRNMipFilterTent:
120 case cCRNMipFilterLanczos4:
122 case cCRNMipFilterMitchell:
124 case cCRNMipFilterKaiser:
132 const char *vogl_get_scale_mode_desc(vogl_scale_mode sm)
142 case cCRNSMLowerPow2:
144 case cCRNSMNearestPow2:
145 return "nearestpow2";