25#include "glTextureDescriptor.h"
28#if defined(__OCPN__ANDROID__)
30#elif defined(__WXQT__) || defined(__WXGTK__)
34wxCriticalSection gs_critSect;
36glTextureDescriptor::glTextureDescriptor() {
37 for (
int i = 0; i < 10; i++) {
40 compcomp_array[i] = NULL;
45 nGPU_compressed = GPU_TEXTURE_UNKNOWN;
50glTextureDescriptor::~glTextureDescriptor() { FreeAll(); }
52void glTextureDescriptor::FreeAll() {
58void glTextureDescriptor::FreeMap() {
59 for (
int i = 0; i < 10; i++) {
65void glTextureDescriptor::FreeComp() {
66 for (
int i = 0; i < 10; i++) {
72void glTextureDescriptor::FreeCompComp() {
73 for (
int i = 0; i < 10; i++) {
74 free(compcomp_array[i]);
75 compcomp_array[i] = NULL;
80size_t glTextureDescriptor::GetMapArrayAlloc(
void) {
81 size_t size = 512 * 512 * 3;
83 for (
int i = 0; i < 10; i++) {
93size_t glTextureDescriptor::GetCompArrayAlloc(
void) {
94 size_t size = (512 * 512 * 3) / 6;
96 for (
int i = 0; i < 10; i++) {
106size_t glTextureDescriptor::GetCompCompArrayAlloc(
void) {
108 for (
int i = 0; i < 10; i++) {
109 if (compcomp_size[i]) ret += compcomp_size[i];
115bool glTextureDescriptor::IsCompCompArrayComplete(
int base_level) {
116 extern int g_mipmap_max_level;
117 for (
int level = base_level; level < g_mipmap_max_level + 1; level++)
118 if (!compcomp_array[level])
return false;