Thanks, you were the first person to actually answer my question.
Type: Posts; User: HelpfulPerson
Thanks, you were the first person to actually answer my question.
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <windows.h>
#include <fcntl.h>
#include <io.h>
Well a big black image on my screen is kind of scary, but yes I know that works. What I'm trying to do is make it appear on the console I attached to. I guess if nothing else I could play a large...
It still says "Could not get the console screen", which means it is failing at the point when it tries to get the video surface, even after adding the check of SDL_init
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <windows.h>
#include <tlhelp32.h>
#include <tchar.h>
Sorry, I didn't realize that about perror. Didn't realize that about the return ( should've used !). Also, no it isn't attached to a console. SDL doesn't make a window by default, so it shouldn't be...
Update : I got the code working finally, but it still doesn't display the image. I get the runtime error of 'Bad file descriptor' when it gets to AttachConsole and the perror function. I got it...
Mainly ease of use. Even though it seems pointless that I'm creating SDL applications to run in other applications, it would be a lot easier later if I wanted to load an image and all I had to do was...
That's still what I did in Code::Blocks. Not sure how I could do it any different. If you have a solution for the big problem that would be nice though
That fixed the implicit declaration error, but it is still telling me about a undefined reference to the function even with linking the kernel32.dll by adding this ( in Code::Blocks minGW32 )
...
I tried this and got 'Undefined reference to AttachConsole' and 'Implicit declaration to AttachConsole function', which is weird, since I included windows.h.
#include <stdio.h>
#include...
Yes, I know that SDL_SetVideoMode creates a new window, I just put it there as a placeholder until I can get the real console window that it is ran in.
I'm trying to get a bitmap image to display on command prompt by using the following code.
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>