Skip to content
Merged

iOS #59

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ jobs:
- name: macOS
os: macos-latest

- name: iOS
os: macos-latest
target: iOS

- name: Android32
os: ubuntu-latest
target: Android32
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "iOS" OR IOS)
set(CMAKE_OSX_ARCHITECTURES "arm64")
else()
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
endif()

project(DevTools VERSION 1.0.0)

Expand Down
5 changes: 3 additions & 2 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"geode": "4.4.0",
"geode": "4.5.0",
"version": "v1.9.1",
"gd": {
"win": "*",
"android": "*",
"mac": "2.2074"
"mac": "2.2074",
"ios": "2.2074"
},
"id": "geode.devtools",
"name": "DevTools",
Expand Down
2 changes: 2 additions & 0 deletions src/backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ void DevTools::renderDrawData(ImDrawData* draw_data) {

static float SCROLL_SENSITIVITY = 10;

#ifndef GEODE_IS_IOS
class $modify(CCMouseDispatcher) {
bool dispatchScrollMSG(float y, float x) {
if(!DevTools::get()->isSetup()) return true;
Expand All @@ -274,6 +275,7 @@ class $modify(CCMouseDispatcher) {
return true;
}
};
#endif

class $modify(CCTouchDispatcher) {
void touches(CCSet* touches, CCEvent* event, unsigned int type) {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ void DevTools::drawAdvancedSettings() {

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

namespace {
Expand Down Expand Up @@ -175,7 +175,7 @@ void DevTools::drawModGraphNode(Mod* node) {
if (!treeNode)
return;

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

ImGui::Text("isInternal: %s", node->isInternal() ? "true" : "false");
ImGui::Text("early: %s", node->needsEarlyLoad() ? "true" : "false");
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Mac.mm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <Geode/platform/platform.hpp>

#ifdef GEODE_IS_MACOS
#if defined(GEODE_IS_MACOS) || defined(GEODE_IS_IOS)

#include "utils.hpp"

Expand Down
8 changes: 6 additions & 2 deletions src/platform/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ ImVec2 GLRenderCtx::size() const {
}

bool GLRenderCtx::begin() {
// save currently bound fbo
// save currently bound fbo and rbo
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &m_prevDrawBuffer);
glGetIntegerv(GL_RENDERBUFFER_BINDING, &m_prevReadBuffer);

if (!m_buffer) {
glGenFramebuffers(1, &m_buffer);
Expand All @@ -76,6 +77,8 @@ bool GLRenderCtx::begin() {
0,GL_RGB, GL_UNSIGNED_BYTE, 0
);

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
Expand Down Expand Up @@ -106,7 +109,8 @@ bool GLRenderCtx::begin() {

void GLRenderCtx::end() {

// bind the framebuffer that was bound before us
// bind the renderbuffer and framebuffer that was bound before us
glBindRenderbuffer(GL_RENDERBUFFER, m_prevReadBuffer);
glBindFramebuffer(GL_FRAMEBUFFER, m_prevDrawBuffer);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
//glFlush();
Expand Down
4 changes: 3 additions & 1 deletion src/platform/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
#include <imgui.h>
#include <imgui_internal.h>
#include <cocos2d.h>
#ifdef __APPLE__
#if defined(GEODE_IS_MACOS)
#include <OpenGL/gl.h>
#elif defined(GEODE_IS_IOS)
#include <OpenGLES/ES2/gl.h>
#endif

ImRect& getGDWindowRect();
Expand Down