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

  • SEARCH
  • Home
  • 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 8068231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T12:35:58+00:00 2026-06-05T12:35:58+00:00

So I have made this program for a game and need help with making

  • 0

So I have made this program for a game and need help with making it a bit more automatic.

The program takes in an image and then displays it. I’m doing this over textures in OpenGL. When I take the screenshot of the game it is usually something about 700×400. I input the height and width into my program, resize the image to 1024×1024 (making it a POT texture for better compatibility) by adding blank space (the original image stays at the top left corner and goes all the way to (700,400) and the rest is just blank; does anyone know the term for this?) and then load it into my program and adjust the corners so only the part from (0,0) to (700,400) is shown.

That’s how I handle the display of the image. Now, I would like to make this automatic. So I’d take a 700×400 picture, pass it to the program which would get the image’s width and height (700×400), resize it to 1024×1024 by adding blank space and then load it.

So does anyone know a C++ library capable of doing this? I would still be taking the screenshot manually though.

I am using the Simple OpenGL Image Library (SOIL) for loading the picture (.bmp) and converting it into a texture.

Thanks!

  • 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-05T12:35:59+00:00Added an answer on June 5, 2026 at 12:35 pm

    You don’t really have to resize by adding blank space to display image properly. In fact, it’s really unefficient way to do it, especially because you store images in .bmp format.

    SOIL is able to automatically add the blank space when loading textures – maybe just try to load the file as-is, without doing any operations.

    From SOIL Documentation:

    Can automatically rescale the image to the next largest power-of-two
    size

    Can load rectangluar textures for GUI elements or splash screens
    (requires GL_ARB/EXT/NV_texture_rectangle)

    Anyway, you don’t have to use texture to display pixels on the screen. I presume you aren’t using shaders for rendering – if it all goes through fixed pipeline, there’s glDrawPixels function, which will be much simpler. Just remember to change your SOIL call to SOIL_load_image.

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

Sidebar

Related Questions

I need help with a program I'm making. It's a version of Conway's Game
I have made a program that scans rss feeds. This same program creates feeds
I have a program i frequently use that is made with .NET. This program
I made this small Java program using eclipse IDE. I have set the workspace
I have made this program and I dont know how to make it run.
I have made this code: var foo=document.createElement(div); var childs=foo.getElementsByTagName(*); console.log(childs.length);//0 OK var a=document.createElement(a); foo.appendChild(a);
Hi have made this function which is made to replicate an error that I
I have made this code to open a database(created in SQLite browser) stored in
I have made this centered navigation bar, and I wanted to add a :active
I have made this webpage, you can check it out here http://www.bettingtowin.net/webcam.html I have

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.