You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
556 B
23 lines
556 B
//
|
|
// texture_objc.mm
|
|
// J
|
|
//
|
|
// Created by Joshua Moerman on 6/23/12.
|
|
// Copyright (c) 2012 Vadovas. All rights reserved.
|
|
//
|
|
|
|
#include "texture_objc.h"
|
|
|
|
#import <UIKit/UIKit.h>
|
|
//#import <Quartz/Quartz.h>
|
|
|
|
namespace J {
|
|
rgba<> texture_from_UIImage(UIImage * image){
|
|
CGImageRef cgImage = image.CGImage;
|
|
CGDataProviderRef provider = CGImageGetDataProvider(cgImage);
|
|
CFDataRef bitmapData = CGDataProviderCopyData(provider);
|
|
CFDataGetBytePtr(bitmapData);
|
|
|
|
return rgba<>(image.size.width, image.size.height, CFDataGetBytePtr(bitmapData));
|
|
}
|
|
}
|