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 6318475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:38:31+00:00 2026-05-24T15:38:31+00:00

How do you render images (.bmp and .jpeg) using OpenGL ? I’ve come across

  • 0

How do you render images (.bmp and .jpeg) using OpenGL ?
I’ve come across some tutorials, but they were for C# not C/C++.
The reason I want to render images, is because I want to draw a spaceship(for a game). I could use a OpenGL primitive, but it doesn’t really look that great. The other option is to draw the spaceship using co-ordinates, but that would take ages, and wouldnt look as good.

running the following snippet always returns failed:

#include <iostream>
#include <GL/glfw.h>
using namespace std;
int main()
{
  GLFWimage image;
  if(glfwReadImage("ship.tga", &image, GLFW_ORIGIN_UL_BIT)!=GL_TRUE);
  cout << "FAILED";
  system("PAUSE");
  return 0;
}

What am I doing wrong ?
Poorly written code. Sorry about that. Works now

  • 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-05-24T15:38:31+00:00Added an answer on May 24, 2026 at 3:38 pm

    By texturing a Quad (or better yet, two Triangles).

    Unless you really need .bmp or .jpeg, I would suggest that you use .tga (Targa) images as they are more commonly used and support alpha channel.

    Some C++ resources:

    http://nehe.gamedev.net/tutorial/loading_compressed_and_uncompressed_tgas/22001/

    http://nehe.gamedev.net/tutorial/texture_mapping/12038/

    http://www.lonesock.net/soil.html (a great little image library for OpenGL. Supports bmp, jpg, png, tga, etc.)

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

Sidebar

Related Questions

We are using Google Charts for render the chart images, but 500 requests/day became
I need to render quite alot (tens of thousands) images off-screen using OpenGL. I
I am using a program what can render color images but only without alpha
I'm trying to render images with verdana text using PHP imagettftext function. However, all
I am using imagefield to render images. These are the urls; (r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root':
I am using Povray to render images over a cluster. Each worker node is
I was able to setup some ASP.NET Image controls to render images from a
I am using gridview example with image adapter to render images with difference that
I'm using a scrollview and a pagecontrol to render several images, very similar to
I'm using asp:Hyperlink to render linked images dynamically based on parameters in the URL.

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.