Skip to content

Commit f9b8319

Browse files
iOS (#59)
Co-Authored-By: [email protected]
1 parent d0c2176 commit f9b8319

File tree

8 files changed

+26
-9
lines changed

8 files changed

+26
-9
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
- name: macOS
2020
os: macos-latest
2121

22+
- name: iOS
23+
os: macos-latest
24+
target: iOS
25+
2226
- name: Android32
2327
os: ubuntu-latest
2428
target: Android32

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
cmake_minimum_required(VERSION 3.21)
22
set(CMAKE_CXX_STANDARD 20)
33
set(CMAKE_CXX_STANDARD_REQUIRED ON)
4-
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
4+
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
5+
set(CMAKE_OSX_ARCHITECTURES "arm64")
6+
else()
7+
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
8+
endif()
59

610
project(DevTools VERSION 1.0.0)
711

mod.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2-
"geode": "4.4.0",
2+
"geode": "4.5.0",
33
"version": "v1.9.1",
44
"gd": {
55
"win": "*",
66
"android": "*",
7-
"mac": "2.2074"
7+
"mac": "2.2074",
8+
"ios": "2.2074"
89
},
910
"id": "geode.devtools",
1011
"name": "DevTools",

src/backend.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ void DevTools::renderDrawData(ImDrawData* draw_data) {
260260

261261
static float SCROLL_SENSITIVITY = 10;
262262

263+
#ifndef GEODE_IS_IOS
263264
class $modify(CCMouseDispatcher) {
264265
bool dispatchScrollMSG(float y, float x) {
265266
if(!DevTools::get()->isSetup()) return true;
@@ -274,6 +275,7 @@ class $modify(CCMouseDispatcher) {
274275
return true;
275276
}
276277
};
278+
#endif
277279

278280
class $modify(CCTouchDispatcher) {
279281
void touches(CCSet* touches, CCEvent* event, unsigned int type) {

src/pages/Advanced.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void DevTools::drawAdvancedSettings() {
1212

1313
void DevTools::drawModGraph() {
1414
// TODO: function to get loader mod
15-
this->drawModGraphNode(Mod::get()->getMetadata().getDependencies()[0].mod);
15+
this->drawModGraphNode(Mod::get()->getMetadataRef().getDependencies()[0].mod);
1616
}
1717

1818
namespace {
@@ -175,7 +175,7 @@ void DevTools::drawModGraphNode(Mod* node) {
175175
if (!treeNode)
176176
return;
177177

178-
node->setMetadata(this->inputMetadata(node, node->getMetadata()));
178+
node->setMetadata(this->inputMetadata(node, node->getMetadataRef()));
179179

180180
ImGui::Text("isInternal: %s", node->isInternal() ? "true" : "false");
181181
ImGui::Text("early: %s", node->needsEarlyLoad() ? "true" : "false");

src/platform/Mac.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <Geode/platform/platform.hpp>
22

3-
#ifdef GEODE_IS_MACOS
3+
#if defined(GEODE_IS_MACOS) || defined(GEODE_IS_IOS)
44

55
#include "utils.hpp"
66

src/platform/platform.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ ImVec2 GLRenderCtx::size() const {
5151
}
5252

5353
bool GLRenderCtx::begin() {
54-
// save currently bound fbo
54+
// save currently bound fbo and rbo
5555
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &m_prevDrawBuffer);
56+
glGetIntegerv(GL_RENDERBUFFER_BINDING, &m_prevReadBuffer);
5657

5758
if (!m_buffer) {
5859
glGenFramebuffers(1, &m_buffer);
@@ -76,6 +77,8 @@ bool GLRenderCtx::begin() {
7677
0,GL_RGB, GL_UNSIGNED_BYTE, 0
7778
);
7879

80+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
81+
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
7982
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
8083
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
8184
}
@@ -106,7 +109,8 @@ bool GLRenderCtx::begin() {
106109

107110
void GLRenderCtx::end() {
108111

109-
// bind the framebuffer that was bound before us
112+
// bind the renderbuffer and framebuffer that was bound before us
113+
glBindRenderbuffer(GL_RENDERBUFFER, m_prevReadBuffer);
110114
glBindFramebuffer(GL_FRAMEBUFFER, m_prevDrawBuffer);
111115
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
112116
//glFlush();

src/platform/platform.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
#include <imgui.h>
44
#include <imgui_internal.h>
55
#include <cocos2d.h>
6-
#ifdef __APPLE__
6+
#if defined(GEODE_IS_MACOS)
77
#include <OpenGL/gl.h>
8+
#elif defined(GEODE_IS_IOS)
9+
#include <OpenGLES/ES2/gl.h>
810
#endif
911

1012
ImRect& getGDWindowRect();

0 commit comments

Comments
 (0)