You Are Here:

Community: Developer Discussion Boards

#1 Old Thumbs down Series 60 BMP Texture Mapping With OpenGL ES Problem - 2005-09-13, 17:09

Join Date: Jan 2005
Posts: 143
abolfoooud
Offline
Regular Contributor
Regards,

i am trying to load a bmp texture to a plane (simple example). the plane is shown on screen. the problem i am facing is creating the loader for the bmp. i used Series60 built-in function CFbsBitmap:: Load(...) to load the bitmap file. then i applied it on a CFbSBitmap object to hold the bitmap data like the following:

iBitMap = new (ELeave) CFbsBitmap();
iBitMap->Create( TSize(256,256), EColor16M );
User::LeaveIfError(iBitMap->Load(KDrawBitmapPath, EMbmBitmapDrawbitmap));

then i created a pointer to point to the first memeory address of the bitmap data array like this:

TUint8 *tex1 = (TUint8*)iBitMap->DataAddress();

now, it is supposed to have all the data in hold and ready for mapping. but, when i apply the glTexImage2D to load the texture, the system crashes. Note that my BMP is 256X256.

/* Enable vertex, normals and texture arrays. */
glEnableClientState( GL_VERTEX_ARRAY );
glEnableClientState( GL_TEXTURE_COORD_ARRAY );
glEnableClientState( GL_NORMAL_ARRAY );

glVertexPointer( 3, GL_BYTE, 0, v); // v array holding plane verts
glTexCoordPointer( 2, GL_BYTE, 0, x); // x holding texture coord
glNormalPointer( GL_BYTE, 0, n); // n hold norms

/* binding the texture */
glGenTextures( 1, iNokTexObjects );
glBindTexture( GL_TEXTURE_2D, iNokTexObjects[0] );
glTexImage2D( GL_TEXTURE_2D, 0, GL_RGB, 256, 256,
0, GL_RGB, GL_UNSIGNED_BYTE, tex1);

// t holds triangles data
glDrawElements( GL_TRIANGLES, 2 * 3, GL_UNSIGNED_BYTE, t);


does this way of loading bmp in Series60 works? i dont know, i just tried to work around the Texture application provided witht he SDK since it uses conversion, coding and decoding for JPeg images. and i dont need JPeg here.
any clue??
Reply With Quote

#2 Old Addition.... - 2005-09-13, 17:13

Join Date: Jan 2005
Posts: 143
abolfoooud
Offline
Regular Contributor
one more thing...
all code for texture mapping requirements is included in AppInit().
if i pass to glTexImage2D the iBitMap instead of tex1 pointer, i get coloured dots on the square, which proves that texturing is enabled but the problem is when i use tex1!!!
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Another OpenGL ES problem rvhaasen Symbian Tools & SDKs 3 2006-08-16 23:48
Problem in NewL() of CVideoPlayerUtility (series 60 2.0 SDK) mishrasaurabh General Symbian C++ 1 2004-12-31 14:08
Series 90 WINS Emulator networking problem redglove Symbian Networking & Messaging 1 2004-11-01 08:34
Transfering image to series 40 device problem andk General Symbian C++ 3 2004-04-20 08:40
Download Poly Ringtone via WAP Problem with Series 40 virak General Browsing 1 2003-09-22 13:41

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ