Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:13:22+00:00 2026-06-11T12:13:22+00:00

The SDL_image API allows you to pass in a FILE* and get an SDL_Surface*.

  • 0

The SDL_image API allows you to pass in a FILE* and get an SDL_Surface*.

Currently, I’m designing a map archive.
One of the files is a tileset. It will be a PNG image (Great format with it’s lossless compression).

I’m reading all the bytes from the file and putting them into a buffer (a byte array).

How would I go about creating a FILE* out of a byte array?
I don’t care if I have to modify anything inside the FILE structure that’s meant to be private, that was my initial approach, but I was facing difficulties figuring out what a couple of the members of the struct are for. (I’m referring to the _iobuf struct)

Edit

You have to understand that I’m using zlib, meaning that when reading from the uncompressed files in the archive, I’m using the function unzReadCurrentFile.
I don’t know if there’s a way to get a FILE* directly while using zlib.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:13:23+00:00Added an answer on June 11, 2026 at 12:13 pm

    You can’t. It’s impossibru. A FILE* is just that- a file. You can’t do anything about the fact that the SDL API uses C I/O and therefore is approximately as useful as a dead fish.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the SDL_Image library and I've added the .so to the
I am using SDL tridion 2011 SP1. I want to get the list of
I'm trying to compile SDL_Image 1.2.10 with MinGW + MSys (gcc 4.5.0) on Windows,
this is a code example from lazyfoo's SDL tutorials. SDL_Surface *load_image( std::string filename )
I'm trying to load an image file and use it as a texture for
I am trying to load a file with a cocoa app but the app
Okay so I'm trying to make a file browser program, and I'm in the
I am loading PNG file (with some transparent places) into my SDL application. Googling
If I try to convert a transparent .png SDL_Surface to a OpenGL texture, then
At the top of my program I have #include SDL/SDL_image.h And when I try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.