Thread: Image displaying

  1. #1
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209

    Image displaying

    I need to learn a way, using a bitmap, to display an array of tiles (for a map) as colored squares. What is the easiest way this can be done and how can it be done?

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Well your going to need to use a graphics libary, I myself am a big fan of allegro.
    Woop?

  3. #3
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    Is there anything I need to install to use a graphics library?

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Yes you are going to need to install the headers and lib files for a library. This depends on your compiler.
    Woop?

  5. #5
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    My compiler is Dev-C++.

  6. #6
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Check to see if your version of Dev-C++ has an update feature. It might be under help or tools. I know with the current version it not only lists updates put development packs as well. One of them should be Allegro.

  7. #7
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Woop?

  8. #8
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    Alright, I downloaded and installed the Allegro Dev-pack. Should that be it before I can use it?

  9. #9
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Everything should work fine start a new project. It will in multimedia
    Woop?

  10. #10
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    Thanks.

  11. #11
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    I'm getting some error messages when I try to compile the program in the first tutorial: It's not telling me that the file <allegro.h> is undefined but it is telling me that there are undefined references to all of the functions in the tutorial. They are all classified as linker errors.

  12. #12
    Slave MadCow257's Avatar
    Join Date
    Jan 2005
    Posts
    735
    A random guess is that you aren't including all of the libs in project settings, the specific errors would help

  13. #13
    C/C++ homeyg's Avatar
    Join Date
    Nov 2004
    Location
    Louisiana, USA
    Posts
    209
    Actually, scratch that. I did what prog-bman said about the projects and now there is only one error: 'no new line at end of file'. What is that supposed to mean?

  14. #14
    Hello,

    This seems to be a continous error. View this previous thread: No newline at end of file


    - Stack Overflow
    Segmentation Fault: I am an error in which a running program attempts to access memory not allocated to it and core dumps with a segmentation violation error. This is often caused by improper usage of pointers, attempts to access a non-existent or read-only physical memory address, re-use of memory if freed within the same scope, de-referencing a null pointer, or (in C) inadvertently using a non-pointer variable as a pointer.

  15. #15
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Quote Originally Posted by homeyg
    Actually, scratch that. I did what prog-bman said about the projects and now there is only one error: 'no new line at end of file'. What is that supposed to mean?
    Kind of a silly error and easily fixed. Make sure each of your code files (.c/.cpp and .h) has a blank line at the bottom.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading tiff image files?
    By compz in forum C++ Programming
    Replies: 9
    Last Post: 10-30-2009, 04:17 AM
  2. Loading & displaying an image
    By csonx_p in forum Windows Programming
    Replies: 1
    Last Post: 06-19-2008, 06:40 AM
  3. Displaying an Image
    By evanman in forum C++ Programming
    Replies: 3
    Last Post: 07-07-2006, 01:04 PM
  4. Button Displaying Image
    By mrafcho001 in forum Windows Programming
    Replies: 4
    Last Post: 12-03-2005, 02:14 PM
  5. Displaying a PNG image
    By grep in forum Windows Programming
    Replies: 5
    Last Post: 07-07-2005, 08:27 PM