Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Texturing in C

  1. #1
    Mephisto
    Guest

    Texturing in C

    Could someone tell me a link to a page where i can find the sourcecode for a program which
    loads an windows bmp file and use it as texture. The sourcecode should be written in C. Donīt send a link to a C++ program, please. I need it in C. If you have such a file at home please mail it to me.
    Breier@odn.de
    It would be the best if i can have a source code with explanations or a tutorial.
    THX
    Breier@odn.de

  2. #2
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    Re: Texturing in C

    I have sent you some files that may be of help.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    19

    Re: Texturing in C

    Could I get that code too?

    daflip@acxiom.com

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    7

    Re: Texturing in C

    And me too please
    le_bayonnais@hotmail.com

  5. #5
    Senior Member Regular Contributor nickels's Avatar
    Join Date
    Feb 2000
    Location
    Colorado
    Posts
    284

    Re: Texturing in C

    I have tossed the code you ways. Some of the code is a bit 'hackish', but hopefully it helps. Windows bitmaps are not to bad to read. Basically you have your headers, the your color palette (unless it is a 24-bit), and then your data. If it's an 8 bit bitmap, you have 256 colormap entries and each byte in the image data is a reference into this table. If it's 4-bit, each byte in the data contains two pixels referencing into a 16 entry colormap (you have to mask out each pixel).
    Two cautions:
    Bitmaps are stored upside-down.
    Each row of bitmap data is 4-byte aligned to the beginning of the data section.
    My code only handles 8-bit bitmaps, but expand away!

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    4

    Re: Texturing in C

    .. I think, I need an example how to use windows-bmp as textures, too Could you mail me some example ?

    Thanx in advance.

    Martin

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2000
    Location
    Southampton England
    Posts
    13

    Re: Texturing in C

    Sorry to keep perstering you. Could I have a copy of this code as well cheers!

    Tom.
    tmwp197@soton.ac.uk
    Tom [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

  8. #8
    Senior Member Regular Contributor fenris's Avatar
    Join Date
    Mar 2000
    Location
    Cincinnati, Ohio USA
    Posts
    129

    Re: Texturing in C

    In my opinion, TGA images are much easier to work with. Windows DIB (BMP) are too proprietary for me, as I like to multi-platform my apps. The RLE encoding of a Windows bitmap is utterly ubsurd in my opinion, as it makes no sense to me what-so-ever. I do have a TGA image reading/writing library I wrote for my apps and the code is GPL'd. It's platform independant and written in C, but works with C++ as well. It supports 8, 16, 24 and 32-bit RGB(A) and RLE compressed TGA images. Drop me a mail if you'd like a copy.

    [This message has been edited by fenris (edited 03-20-2000).]

  9. #9
    Junior Member Newbie
    Join Date
    Sep 2005
    Posts
    3

    Re: Texturing in C

    Originally posted by fenris:
    In my opinion, TGA images are much easier to work with. Windows DIB (BMP) are too proprietary for me, as I like to multi-platform my apps. The RLE encoding of a Windows bitmap is utterly ubsurd in my opinion, as it makes no sense to me what-so-ever. I do have a TGA image reading/writing library I wrote for my apps and the code is GPL'd. It's platform independant and written in C, but works with C++ as well. It supports 8, 16, 24 and 32-bit RGB(A) and RLE compressed TGA images. Drop me a mail if you'd like a copy.

    [This message has been edited by fenris (edited 03-20-2000).]
    could you send me this TGA reading Library? or tell me where to download? THX puerrom at gmail dot com

  10. #10
    Senior Member Frequent Contributor
    Join Date
    Apr 2000
    Location
    Adelaide, South Australia, Australia
    Posts
    763

    Re: Texturing in C

    http://www.wotsit.org/

    seriously. Anyways, what's the story with the "it has to be C and not C++"? C++ is not THAT obsiscated that translating it is prohibitively difficult!?

Page 1 of 2 12 LastLast

Similar Threads

  1. 3D texturing from C#
    By tareq91 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-15-2013, 04:12 AM
  2. Multi-Texturing and .... normal texturing?
    By Andy Gilbert in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-06-2010, 05:30 PM
  3. Texturing and Texturing (newbie)
    By Sudeepa in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 12-17-2008, 05:47 AM
  4. help please! (gf3 texturing)
    By tweakoz in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-14-2002, 09:25 AM
  5. texturing
    By littledevore in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-13-2001, 01:42 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
  •  
Proudly hosted by Digital Ocean