Herramientas de usuario

Herramientas del sitio


wiki2:cpp:libraries:openframeworks

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
wiki2:cpp:libraries:openframeworks [2015/08/04 19:20]
alfred [ofxNetwork]
wiki2:cpp:libraries:openframeworks [2020/05/09 09:25] (actual)
Línea 5: Línea 5:
   * Follow the tutorial until have OpenFrameworks and Addons in your projects.   * Follow the tutorial until have OpenFrameworks and Addons in your projects.
  
-You only need to add OpenFrameworks and Addons projects as references in your new project. 
  
 +Import the generated project as "​Existing code as makefile project"​. You only need to add OpenFrameworks and Addons projects as references in your new project (do not forget to select "Linux GCC").
 ==== Notes ==== ==== Notes ====
   * **To add an addon after having created the project** you just need to include its name in the ''​addons.make''​ file.   * **To add an addon after having created the project** you just need to include its name in the ''​addons.make''​ file.
-  * +  * To compile with **C++11** you need to go to ''​libs/​openFrameworksCompiled/​project/​makefileCommon''​ path and edit the main makefile which is ''​compile.project.mk''​. You need to search for the rule that does the compilation and add: ''​-std=c++0x''​. 
 +<code cpp> 
 +$(OF_PROJECT_OBJ_OUPUT_PATH)%.o:​ $(PROJECT_ROOT)/​%.cpp 
 + @echo "​Compiling"​ $< 
 + @mkdir -p $(@D) 
 + $(CXX) -c $(OPTIMIZATION_CFLAGS) $(CFLAGS) $(CXXFLAGS) -std=c++0x -MMD -MP -MF $(OF_PROJECT_OBJ_OUPUT_PATH)$*.d -MT $(OF_PROJECT_OBJ_OUPUT_PATH)$*.o -o $@ -c $< 
 +</​code>​ 
 +  * Muy probablemente quieras usar otras libs, las tendrías que añadir también en el makefile: 
 +<code cpp> 
 +$(TARGET): $(OF_PROJECT_OBJS) $(OF_PROJECT_ADDONS_OBJS) $(OF_PROJECT_LIBS) $(TARGET_LIBS) 
 + @echo '​Linking $(TARGET) for $(ABI_LIB_SUBPATH)'​ 
 + @mkdir -p $(@D) 
 + $(CXX) -o $@ $(OF_PROJECT_OBJS) $(OF_PROJECT_ADDONS_OBJS) $(TARGET_LIBS) $(OF_PROJECT_LIBS) $(LDFLAGS) $(OF_CORE_LIBS) ​ -lboost_system -lboost_timer -lboost_thread  
 +</​code>​ 
 +===== Useful data ===== 
 +==== Obtain information ==== 
 + 
 +  * Ventana 
 +    * ofGetWidth(),​ ofGetHeight() 
 +  * Programa 
 +    * ofGetElapsedTimef(),​ ofGetElapsedTimeMicros(),​ ofGetElapsedTimeMillis() 
 + 
 +==== Useful constants ==== 
 + 
 +  * TWO_PI 
 +  * DEG_TO_RAD (any number we multiply by DEG_TO_RAD will be converted to radians) 
 +===== Graphics ===== 
 + 
 +  * [[wiki2:​cpp:​libraries:​openframeworks:​creating_graphics|Creating Graphics]]
 ===== Addons ===== ===== Addons =====
  
Línea 17: Línea 45:
 Crear un listener de UDP: Crear un listener de UDP:
 <code cpp> <code cpp>
 +#include "​ofxNetwork.h"​
 +
 ofxUDPManager udpConnection;​ ofxUDPManager udpConnection;​
  
Línea 31: Línea 61:
   * https://​github.com/​jefftimesten/​ofxJSON   * https://​github.com/​jefftimesten/​ofxJSON
 <code cpp> <code cpp>
 +#include "​ofxJSON.h"​
 +...
 ofxJSONElement result; ofxJSONElement result;
 std::string url = "​http://​127.0.0.1:​5000/​sketch/​1";​ std::string url = "​http://​127.0.0.1:​5000/​sketch/​1";​
Línea 56: Línea 88:
 </​code>​ </​code>​
  
-==== Snippets ​====+==== Addons Repository ​==== 
 + 
 +  * http://​www.ofxaddons.com/​categories
  
 +===== Snippets =====
  
 +  * [[wiki2:​cpp:​libraries:​openframeworks:​snippets|OpenFrameworks Snippets]]
wiki2/cpp/libraries/openframeworks.1438716018.txt.gz · Última modificación: 2020/05/09 09:25 (editor externo)