25 #include "glTextureDescriptor.h"
26 #include <wx/thread.h>
28 #if defined(__OCPN__ANDROID__)
29 #include <GLES2/gl2.h>
30 #elif defined(__WXQT__) || defined(__WXGTK__)
34 wxCriticalSection gs_critSect;
36 glTextureDescriptor::glTextureDescriptor() {
37 for (
int i = 0; i < 10; i++) {
40 compcomp_array[i] = NULL;
45 nGPU_compressed = GPU_TEXTURE_UNKNOWN;
50 glTextureDescriptor::~glTextureDescriptor() { FreeAll(); }
52 void glTextureDescriptor::FreeAll() {
58 void glTextureDescriptor::FreeMap() {
59 for (
int i = 0; i < 10; i++) {
65 void glTextureDescriptor::FreeComp() {
66 for (
int i = 0; i < 10; i++) {
72 void glTextureDescriptor::FreeCompComp() {
73 for (
int i = 0; i < 10; i++) {
74 free(compcomp_array[i]);
75 compcomp_array[i] = NULL;
80 size_t glTextureDescriptor::GetMapArrayAlloc(
void) {
81 size_t size = 512 * 512 * 3;
83 for (
int i = 0; i < 10; i++) {
93 size_t glTextureDescriptor::GetCompArrayAlloc(
void) {
94 size_t size = (512 * 512 * 3) / 6;
96 for (
int i = 0; i < 10; i++) {
106 size_t glTextureDescriptor::GetCompCompArrayAlloc(
void) {
108 for (
int i = 0; i < 10; i++) {
109 if (compcomp_size[i]) ret += compcomp_size[i];
115 bool 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;