This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Shows what to do when creating an enum value from a integer value | |
enum ThemeColor { red, green,} | |
void main() { | |
try { | |
final nonExistent = ThemeColor.values[3]; | |
print("Non existent enum is $nonExistent"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface SREAGLContext : NSObject | |
+ (EAGLContext*)sharedContext; | |
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
@end | |
@implementation SREAGLContext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// don't forget to include related head files | |
void BindCVMat2GLTexture(cv::Mat& image, GLuint& imageTexture) | |
{ | |
if(image.empty()){ | |
std::cout << "image empty" << std::endl; | |
}else{ | |
//glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | |
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
glGenTextures(1, &imageTexture1); | |
glBindTexture(GL_TEXTURE_2D, imageTexture1); |