Skip to content

Commit ad4bc6e

Browse files
committed
remove opengl
1 parent e285b9c commit ad4bc6e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+45
-15875
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
[submodule "externals/freetype/freetype"]
1414
path = externals/freetype/freetype
1515
url = https://github.com/ucpu/freetype.git
16-
[submodule "externals/glad/glad"]
17-
path = externals/glad/glad
18-
url = https://github.com/ucpu/glad.git
1916
[submodule "externals/glm/glm"]
2017
path = externals/glm/glm
2118
url = https://github.com/g-truc/glm.git

cmake/cage_build_configuration.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ macro(cage_build_configuration)
1313
set(CMAKE_C_STANDARD_REQUIRED ON)
1414
set(CMAKE_CXX_STANDARD 20)
1515
set(CMAKE_CXX_STANDARD_REQUIRED ON)
16+
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
1617

1718
# default visibility hidden
1819
set(CMAKE_C_VISIBILITY_PRESET hidden)

externals/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ add_subdirectory(unordered_dense)
101101
add_subdirectory(wamr)
102102

103103
add_subdirectory(dawn)
104-
add_subdirectory(glad)
105104
add_subdirectory(glfw)
106105
add_subdirectory(glm)
107106
add_subdirectory(openxr-sdk)

externals/glad/CMakeLists.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

externals/glad/glad

Lines changed: 0 additions & 1 deletion
This file was deleted.

sources/CMakeLists.txt

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ cage_ide_sort_files(cage-core)
7474
file(GLOB_RECURSE cage-engine-sources "libengine/*" "include/cage-engine/*")
7575
add_library(cage-engine SHARED ${cage-engine-sources})
7676
target_link_libraries(cage-engine PRIVATE cubeb glfw webgpu::dawn openxr_loader freetype harfbuzz SheenBidi)
77-
target_link_libraries(cage-engine PUBLIC cage-core glad)
77+
target_link_libraries(cage-engine PUBLIC cage-core)
7878
file(GLOB_RECURSE controller-bindings RELATIVE "${CMAKE_CURRENT_LIST_DIR}" "controller-bindings/*")
7979
set(index 0)
8080
foreach(cb IN ITEMS ${controller-bindings})
@@ -92,11 +92,13 @@ cage_ide_sort_files(cage-engine)
9292
# SIMPLE
9393
########
9494

95-
file(GLOB_RECURSE cage-simple-sources "libsimple/*" "include/cage-simple/*")
96-
add_library(cage-simple STATIC ${cage-simple-sources})
97-
target_link_libraries(cage-simple PUBLIC cage-engine)
98-
cage_ide_category(cage-simple cage/libs)
99-
cage_ide_sort_files(cage-simple)
95+
# temporarily disabled
96+
97+
#file(GLOB_RECURSE cage-simple-sources "libsimple/*" "include/cage-simple/*")
98+
#add_library(cage-simple STATIC ${cage-simple-sources})
99+
#target_link_libraries(cage-simple PUBLIC cage-engine)
100+
#cage_ide_category(cage-simple cage/libs)
101+
#cage_ide_sort_files(cage-simple)
100102

101103
########
102104
# DATA
@@ -122,9 +124,7 @@ cage_ide_sort_files(cage-test-core)
122124
cage_ide_working_dir_in_place(cage-test-core)
123125
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
124126
target_compile_options(cage-test-core PRIVATE "-Wno-unused-variable")
125-
if ((NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 13)) # clang-12 does not have this warning yet
126-
target_compile_options(cage-test-core PRIVATE "-Wno-unused-but-set-variable")
127-
endif()
127+
target_compile_options(cage-test-core PRIVATE "-Wno-unused-but-set-variable")
128128
endif()
129129
file(GLOB_RECURSE wasm-files RELATIVE "${CMAKE_CURRENT_LIST_DIR}/test-core/wasm" "*.wasm")
130130
foreach(wf IN ITEMS ${wasm-files})
@@ -184,21 +184,3 @@ target_link_libraries(cage-asset-processor cage-engine freetype lib_msdfgen)
184184

185185
add_dependencies(cage-asset-database cage-asset-processor)
186186
add_dependencies(cage-asset-analyze cage-asset-processor)
187-
188-
########
189-
# INSTALL
190-
########
191-
192-
option(cage_install_enabled "enable installing cage" ON)
193-
include(GNUInstallDirs)
194-
if (cage_install_enabled)
195-
install(TARGETS unordered_dense plf glad EXPORT CageConfig)
196-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../externals/unordered_dense/unordered_dense/include/ankerl/unordered_dense.h" DESTINATION include)
197-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../externals/plf/plf_colony/plf_colony.h" DESTINATION include)
198-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../externals/plf/plf_list/plf_list.h" DESTINATION include)
199-
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/../externals/plf/plf_stack/plf_stack.h" DESTINATION include)
200-
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../externals/glad/glad/include" DESTINATION .)
201-
install(TARGETS cage-core cage-engine cage-simple ${cage_tools_targets_list} EXPORT CageConfig)
202-
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include" DESTINATION .)
203-
install(EXPORT CageConfig DESTINATION cmake)
204-
endif()

sources/asset-processor/font.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
#include <cage-core/imageAlgorithms.h>
1717
#include <cage-core/rectPacking.h>
1818
#include <cage-core/tasks.h>
19-
#include <cage-engine/opengl.h>
20-
#include <cage-engine/texture.h>
19+
//#include <cage-engine/texture.h>
2120

2221
#define FT_CALL(FNC, ...) \
2322
if (const FT_Error err = FNC(__VA_ARGS__)) \
@@ -30,7 +29,11 @@ namespace cage
3029
{
3130
namespace privat
3231
{
33-
CAGE_ENGINE_API cage::String translateFtErrorCode(FT_Error code);
32+
//CAGE_ENGINE_API cage::String translateFtErrorCode(FT_Error code);
33+
cage::String translateFtErrorCode(FT_Error code)
34+
{
35+
throw;
36+
}
3437
}
3538
}
3639

@@ -206,6 +209,7 @@ namespace
206209
{
207210
TextureHeader data;
208211
detail::memset(&data, 0, sizeof(TextureHeader));
212+
/*
209213
data.target = GL_TEXTURE_2D;
210214
data.resolution = Vec3i(img->width(), img->height(), 1);
211215
data.channels = img->channels();
@@ -224,6 +228,7 @@ namespace
224228
data.copyType = GL_UNSIGNED_BYTE;
225229
data.internalFormat = GL_RGB8;
226230
data.copyFormat = GL_RGB;
231+
*/
227232

228233
MemoryBuffer inputBuffer;
229234
Serializer ser(inputBuffer);
@@ -233,7 +238,7 @@ namespace
233238
ser.write(bufferCast(img->rawViewU8()));
234239

235240
AssetHeader h = processor->initializeAssetHeader();
236-
h.scheme = AssetSchemeIndexTexture;
241+
//h.scheme = AssetSchemeIndexTexture;
237242
h.originalSize = inputBuffer.size();
238243
Holder<PointerRange<char>> outputBuffer = memoryCompress(inputBuffer);
239244
h.compressedSize = outputBuffer.size();

sources/asset-processor/shader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <cage-core/hashString.h>
99
#include <cage-core/timer.h>
1010
#include <cage-engine/assetStructs.h>
11-
#include <cage-engine/opengl.h>
1211

1312
namespace
1413
{
@@ -243,6 +242,7 @@ namespace
243242

244243
uint32 shaderType(const String &name)
245244
{
245+
/*
246246
if (name == "vertex")
247247
return GL_VERTEX_SHADER;
248248
if (name == "fragment")
@@ -255,6 +255,7 @@ namespace
255255
return GL_TESS_EVALUATION_SHADER;
256256
if (name == "compute")
257257
return GL_COMPUTE_SHADER;
258+
*/
258259
return 0;
259260
}
260261

sources/asset-processor/texture.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
#include <cage-core/imageImport.h>
77
#include <cage-core/meshImport.h>
88
#include <cage-core/pointerRangeHolder.h>
9-
#include <cage-engine/opengl.h>
109

1110
void meshImportNotifyUsedFiles(const MeshImportResult &result);
1211

1312
namespace
1413
{
1514
uint32 convertFilter(const String &f)
1615
{
16+
/*
1717
if (f == "nearestMipmapNearest")
1818
return GL_NEAREST_MIPMAP_NEAREST;
1919
if (f == "linearMipmapNearest")
@@ -26,11 +26,13 @@ namespace
2626
return GL_NEAREST;
2727
if (f == "linear")
2828
return GL_LINEAR;
29+
*/
2930
return 0;
3031
}
3132

3233
bool requireMipmaps(const uint32 f)
3334
{
35+
/*
3436
switch (f)
3537
{
3638
case GL_NEAREST_MIPMAP_NEAREST:
@@ -41,10 +43,13 @@ namespace
4143
default:
4244
return false;
4345
}
46+
*/
47+
return true;
4448
}
4549

4650
uint32 convertWrap(const String &f)
4751
{
52+
/*
4853
if (f == "clampToEdge")
4954
return GL_CLAMP_TO_EDGE;
5055
if (f == "clampToBorder")
@@ -53,12 +58,14 @@ namespace
5358
return GL_MIRRORED_REPEAT;
5459
if (f == "repeat")
5560
return GL_REPEAT;
61+
*/
5662
return 0;
5763
}
5864

5965
uint32 convertTarget()
6066
{
6167
const String f = processor->property("target");
68+
/*
6269
if (f == "2d")
6370
return GL_TEXTURE_2D;
6471
if (f == "2dArray")
@@ -67,11 +74,13 @@ namespace
6774
return GL_TEXTURE_CUBE_MAP;
6875
if (f == "3d")
6976
return GL_TEXTURE_3D;
77+
*/
7078
return 0;
7179
}
7280

7381
uint32 findInternalFormatForBcn(const TextureHeader &data)
7482
{
83+
/*
7584
if (any(data.flags & TextureFlags::Srgb))
7685
{
7786
switch (data.channels)
@@ -96,11 +105,13 @@ namespace
96105
return GL_COMPRESSED_RGBA_BPTC_UNORM;
97106
}
98107
}
108+
*/
99109
CAGE_THROW_ERROR(Exception, "invalid number of channels in texture");
100110
}
101111

102112
uint32 findInternalFormatForRaw(const TextureHeader &data)
103113
{
114+
/*
104115
if (any(data.flags & TextureFlags::Srgb))
105116
{
106117
switch (data.channels)
@@ -125,11 +136,13 @@ namespace
125136
return GL_RGBA8;
126137
}
127138
}
139+
*/
128140
CAGE_THROW_ERROR(Exception, "invalid number of channels in texture");
129141
}
130142

131143
uint32 findCopyFormatForRaw(const TextureHeader &data)
132144
{
145+
/*
133146
switch (data.channels)
134147
{
135148
case 1:
@@ -141,6 +154,7 @@ namespace
141154
case 4:
142155
return GL_RGBA;
143156
}
157+
*/
144158
CAGE_THROW_ERROR(Exception, "invalid number of channels in texture");
145159
}
146160

@@ -227,6 +241,7 @@ namespace
227241

228242
void performDownscale(const uint32 downscale, const uint32 target)
229243
{
244+
/*
230245
if (target == GL_TEXTURE_3D)
231246
{ // downscale image as a whole
232247
CAGE_LOG(SeverityEnum::Info, "assetProcessor", Stringizer() + "downscaling whole image (3D)");
@@ -238,6 +253,7 @@ namespace
238253
for (auto &it : images.parts)
239254
imageResize(+it.image, max(it.image->width() / downscale, 1u), max(it.image->height() / downscale, 1u));
240255
}
256+
*/
241257
}
242258

243259
void performSkyboxToCube()
@@ -301,6 +317,7 @@ namespace
301317

302318
void checkConsistency(const uint32 target)
303319
{
320+
/*
304321
const uint32 frames = numeric_cast<uint32>(images.parts.size());
305322
if (frames == 0)
306323
CAGE_THROW_ERROR(Exception, "no images were loaded");
@@ -327,6 +344,7 @@ namespace
327344
}
328345
if (target == GL_TEXTURE_CUBE_MAP && im0->width() != im0->height())
329346
CAGE_THROW_ERROR(Exception, "cube texture requires square textures");
347+
*/
330348
}
331349

332350
void exportBcn(TextureHeader &data, Serializer &ser)
@@ -389,6 +407,7 @@ namespace
389407

390408
void exportTexture(const uint32 target)
391409
{
410+
/*
392411
TextureHeader data;
393412
detail::memset(&data, 0, sizeof(TextureHeader));
394413
data.target = target;
@@ -445,6 +464,7 @@ namespace
445464
f->write(bufferView(h));
446465
f->write(outputBuffer);
447466
f->close();
467+
*/
448468
}
449469
}
450470

sources/include/cage-engine/font.h

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)