Giter VIP home page Giter VIP logo

ofxeasyretina's Introduction

ofxEasyRetina

Simple OpenFrameworks addon allows you to enable retina graphics on iOS without modifying the original appearance of the app. In OpenFrameworks, when you enable retina on your device, the canvas size is doubled, ofGetWidth() and ofGetHeight() are doubled too, everything ends up looking tiny.

image

With ofxEasyRetina, everything is upscaled as expected, just with twice the resolution. Your touch input will also behave as expected, and so will ofGetWidth() and ofGetHeight();

image

PD: This is quite an ugly hack, but it makes it very easy to make retina compatible an exising non-retina project.

How to use

	//enable retina before you create the window, in main.m ///////////////////
	
	int main(){

		ofAppiPhoneWindow * iOSWindow = new ofAppiPhoneWindow();
		iOSWindow->enableRetinaSupport(); //enable retina!
		ofSetupOpenGL(iOSWindow, 480, 320, OF_FULLSCREEN);
		ofRunApp(new testApp);
	}

	//include these two files in testApp.h ////////////////////////////////////
	
	#include "ofxEasyRetina.h"
	#include "ofxiOSEAGLView+retinaPatch.h"

	class testApp : public ofxiPhoneApp{
		public:
    		void setup();
			void update();
	        void draw();
	
			ofxEasyRetina retina; //declare an ofxEasyRetina instance
	};
	
	//Setup the screen before drawing in testApp.mm ///////////////////////////
	
	void testApp::draw(){
		retina.setupScreenOrtho(); //make ofxEasyRetina setup your screen
		
		//done! draw your stuff!!
	}

To Do

  • tested on OF0073, and not much!

ofxeasyretina's People

Contributors

armadillu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ofxeasyretina's Issues

Warning message in "ofxiOSEAGLView+retinaPatch.m"

Hi armadillu.
When I build a project using ofxEasyRetina addon I get this warning message :
Category is implementing a method which also be implemented by its primary class. addressed in - (void)updateDimensions. I check in the ofxiOSEAGLView+retinaPatch.h and I noticed that the (- (void)updateDimensions) is declared twice in .h and .m. I commented (- (void)updateDimensions) in ofxiOSEAGLView+retinaPatch.m and warning message has gone.
Thank you.. and sorry for my poor english.

Just want to thank you !

This is no issue about ofxEasyRetina. I chose this issue post to thank you for these helpful addons and examples. I learned alot from your code.
Thank you. ๐Ÿ‘

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.