Discuss Getting bitmap from local image C++/OpenGL at the Free Toolchain Software - Hackint0sh.org; Hello,
Haven t found any forum for that so just try here.
I want to ...
-
Getting bitmap from local image C++/OpenGL
Hello,
Haven t found any forum for that so just try here.
I want to get the bitmap image from a local JPG or TIFF to use as an OpenGL texture in C++ on the iPhone.
So normally the image is loaded with a UIImage or a UIImageView from the UIKit but I don t know how to get the bitmap buffer to create an OpenGL Texture.
Thanks for any help, if any
-
-
Hey,
I did exactly that. I used a UIImage to load something on a CGImageRef:
UIImage* image = [UIImage imageNamed: fileName];
CGImageRef inImage = image.imageRef;
Then just create a context and use CGBitmapContextGetData to grab the raw data. THen it's just a matter of using glTexImage2D to create the GL texture.
Works a treat for me!
Cheers,
Max
-
Similar Threads
-
By hackint0sh in forum Latest Headlines
Replies: 0
Last Post: 01-12-2010, 06:20 PM
-
By riruilo in forum iPhone Developer Exchange
Replies: 14
Last Post: 11-18-2009, 01:12 AM
-
By xinos in forum Using Leopard
Replies: 1
Last Post: 03-08-2009, 05:49 PM
-
By TheSacredSoul in forum General
Replies: 0
Last Post: 02-28-2008, 01:36 PM
-
Replies: 0
Last Post: 09-14-2007, 05:50 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks