forked from julapy/ofxFlashLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathofxFlashLibraryLoader.cpp
More file actions
38 lines (28 loc) · 900 Bytes
/
ofxFlashLibraryLoader.cpp
File metadata and controls
38 lines (28 loc) · 900 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* ofxFlashLibraryLoader.cpp
* iPhoneEmptyExample
*
* Created by lukasz karluk on 10/02/11.
* Copyright 2011 __MyCompanyName__. All rights reserved.
*
*/
#include "ofxFlashLibraryLoader.h"
#ifndef TARGET_OF_IPHONE
ofxFlashLibraryLoader* ofxFlashLibraryLoader :: _instance = NULL;
ofBaseDraws* ofxFlashLibraryLoader :: loadImage( string imagePath )
{
ofImage image;
if( !image.loadImage( imagePath ) )
return NULL;
ofTexture* tex = new ofTexture();
tex->allocate( image.getWidth(), image.getHeight(), image.getTextureReference().getTextureData().glType );
tex->loadData( image.getPixels(), image.getWidth(), image.getHeight(), image.getTextureReference().getTextureData().glType );
return tex;
}
ofBaseDraws* ofxFlashLibraryLoader :: loadVideo( string videoPath )
{
ofVideoPlayer* video = new ofVideoPlayer();
video->loadMovie( videoPath );
return video;
}
#endif