Skip to content
Open
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
6 changes: 5 additions & 1 deletion addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#include "ofEvents.h"
#include "ofGLProgrammableRenderer.h"

#ifndef OF_WEBGL_VERSION
#define OF_WEBGL_VERSION 2
#endif

using namespace std;

ofxAppEmscriptenWindow * ofxAppEmscriptenWindow::instance = NULL;
Expand Down Expand Up @@ -38,7 +42,7 @@ void ofxAppEmscriptenWindow::setup(const ofGLESWindowSettings & settings){
attrs.depth = 1;
attrs.stencil = 1;
attrs.antialias = 1;
attrs.majorVersion = 2;
attrs.majorVersion = OF_WEBGL_VERSION;
attrs.minorVersion = 0;
attrs.alpha = 0;

Expand Down
5 changes: 5 additions & 0 deletions addons/ofxiOS/src/ofxiOSConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ enum ofxiOSRendererType {
OFXIOS_RENDERER_METAL = 4
};

// OF_GLES_VERSION=1|2|3 in the project defines to override or in projectGenerator from 0.99.0
#ifndef OF_GLES_VERSION
#define OF_GLES_VERSION OFXIOS_RENDERER_ES2
#endif

enum ofxiOSWindowControllerType{
CORE_ANIMATION = 1,
GL_KIT = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ ifneq ($(strip $(wildcard bin/data/*)),)
PLATFORM_LDFLAGS += --preload-file bin/data@data
endif
PLATFORM_LDFLAGS += --use-port=emdawnwebgpu
# PROJECT_DEFINES += OF_WEBGL_VERSION=1 in config.make for a WebGL 1 only build (default WebGL 2)
ifneq ($(filter OF_WEBGL_VERSION=1,$(PROJECT_DEFINES)),)
PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=1 -s FULL_ES2
else
PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES3
endif
PLATFORM_LDFLAGS += -s AUTO_NATIVE_LIBRARIES=1
PLATFORM_LDFLAGS += -s AUTO_JS_LIBRARIES=1

Expand Down
6 changes: 5 additions & 1 deletion scripts/templates/ios/src/main.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "ofApp.h"

#ifndef OF_GLES_VERSION
#define OF_GLES_VERSION OFXIOS_RENDERER_ES2
#endif

int main() {

// here are the most commonly used iOS window settings.
Expand All @@ -11,7 +15,7 @@ int main() {
settings.numOfAntiAliasingSamples = 0; // number of samples used for anti-aliasing.
settings.enableHardwareOrientation = false; // enables native view orientation.
settings.enableHardwareOrientationAnimation = false; // enables native orientation changes to be animated.
settings.glesVersion = OFXIOS_RENDERER_ES2; // type of renderer to use, ES1, ES2, ES3
settings.glesVersion = OF_GLES_VERSION; // type of renderer to use, ES1, ES2, ES3 - default ES2, set via OF_GLES_VERSION define
settings.windowControllerType = ofxiOSWindowControllerType::GL_KIT; // Window Controller Type
settings.colorType = ofxiOSRendererColorFormat::RGBA8888; // color format used default RGBA8888
settings.depthType = ofxiOSRendererDepthFormat::DEPTH_NONE; // depth format (16/24) if depth enabled
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/linux/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/linux64/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/linuxarmv6l/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/linuxarmv7l/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/msys2/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/osx/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
6 changes: 5 additions & 1 deletion scripts/templates/tvOS/src/main.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include "ofApp.h"

#ifndef OF_GLES_VERSION
#define OF_GLES_VERSION OFXIOS_RENDERER_ES2
#endif

int main() {

// here are the most commonly used iOS window settings.
Expand All @@ -11,7 +15,7 @@ int main() {
settings.numOfAntiAliasingSamples = 0; // number of samples used for anti-aliasing.
settings.enableHardwareOrientation = false; // enables native view orientation.
settings.enableHardwareOrientationAnimation = false; // enables native orientation changes to be animated.
settings.glesVersion = OFXIOS_RENDERER_ES2; // type of renderer to use, ES1, ES2, ES3
settings.glesVersion = OF_GLES_VERSION; // type of renderer to use, ES1, ES2, ES3 - default ES2, set via OF_GLES_VERSION define
settings.windowControllerType = ofxiOSWindowControllerType::GL_KIT; // Window Controller Type
settings.colorType = ofxiOSRendererColorFormat::RGBA8888; // color format used default RGBA8888
settings.depthType = ofxiOSRendererDepthFormat::DEPTH_NONE; // depth format (16/24) if depth enabled
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/vs/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/vs2019/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/vs2026/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
4 changes: 4 additions & 0 deletions scripts/templates/vscode/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ int main( ){
settings.setSize(1024, 768);
settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN

#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR)
settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version
#endif

auto window = ofCreateWindow(settings);

ofRunApp(window, std::make_shared<ofApp>());
Expand Down
Loading