Using SDL with Win32 Window - c

I'm using gcc in Codeblocks for my c programming on Windows Xp.
When learning c I created a basic program that takes a book text file and counts the letter frequency.
A couple of months later when learning SDL basics i thought it would be a good idea to
create a bar graph to display the results of the c program.
I now have 2 working programs BUT with no idea of how to combine them.
Searching the net has produced numerous mentions of a Windows hack that allows SDL
to be displayed inside a Win32 window, but i've been unable to find an actual code routine.
I know at some point I will have to learn Windows programming, but was hoping i could find a short, quick fix meanwhile.

I ended up changing my approach and coded a pure SDL program.

Related

Is there any better and more suitable compiler for running basic graphics programs in c other than turbo c++?

I am trying to learn basic graphics programs in C and i want a more friendly and convenient compiler than turbo c which i am not able to find. Is there any better c compiler for graphics programs?
I would suggest you to use SDL2 for graphics programming. It is quite easy to use and allows you to draw simple shapes (circles, lines, rectangles, text, etc.)
Also you can easily set it up for modern IDE's such Visual Studio and Code Blocks.
Just google for " SDL setup" and you are good to go. Comment here if you are stuck somewhere.

Using CDK and Ncurses under Microsoft Windows

I wrote a program in C that uses the CDK to create an user interface. It works great under Linux, but some people under Windows need it.
I've heard that Cygwin could help me, so last 3 days I was trying to recompile my program with the help of Cygwin. I tried a lot of things, like differents compilers, recompile nCurses from source, recompile CDK from source, using PDCurses... but I always failed. I got many types of problems and errors so I just can't list that here...
Is there a solution to use the CDK library under Windows ?

C Programming with Cygwin and gdbtui

my question is regarding to the use of Cygwin and gdb. I was working on a school project but they want me to practice without the use of Visual Studio or similar compilers.
My questions is.. How would I be able to code C? Would this be on a text program or on Cygwin itself?
Thank you.
The Code::Blocks IDE may arguably be considered too close to Visual Studio, but until you learn the in's and out's of it, it's really just a place to write and compile code. You can keep to the spirit of the request by just using it as such rather than digging into its full capabilities.
If you really need to do it from scratch, use any text editor (eg: Notepad) and manually compile like this: http://ce.uml.edu/compile.htm
You can write program using any good text editor like this.
If you have cygwin installed on your system then you can just add c/c++ compiler (like gcc) to it and compile the program.
You always need not to use IDE for writing and compilation of programs.
Even though #Dinah does answer your question we still have not discussed about the way to use the gdb debugger .
Since you are starting out new i suggest you master debugging using a debugger like gdb . Believe me you will save tonnes of time figuring out what went wrong using print statements ( or any other equivalent mechanisms )
Here is a good place where you can start learn to use gdb
Have fun!

How can I create a GUI for a text based program?

I'm quite in a basic project for now which is recoding a unix shell in C. It is of course intended to work in a tty which means without a GUI. Though I'd like to add an option to use it with a graphical mode. As it's a text based program, when I launch it with Gnome (using alacarte) it launches itself in a Gnome Terminal. What I want to add is a sort of graphical interface like the Gnome Terminal app. Is there a simple way to put a text based program in a sort of frame with graphical elements in it ? I want to get rid of any other application to launch my shell so when I'm in graphical mode (when not using tty) I want my own frame and not another application that launches it.
Can anyone help me ? =)
You cannot create a GUI using the standard C library. You can make one with an external library though.
With OpenCV, it is possible to make a GUI, and there is a large community behind the project. You can find lots of code examples and tutorials on their website. In addition, you can use OpenCV for lots of other computer vision related things.
You could also use GTK+ to write a GUI for your program. It is very simple, and easy to use for beginners. It's more focused on graphics though, and if you want another functionality required by an external library, you might not be able to use GTK+.

Best quick alternative compiler/IDE to Turbo C that supports audio and graphics

I am making a small 2d GAME PACK as my University project. I am using Turboc 3.0 as the compiler. I am at a stage where I need better graphics and sound. Ive spent days looking for a workaround on the net and by myself too including audio and better graphics.Can you please tell me which Ide can be learnt quickly, as time is a constraint here?
Turbo C is just an IDE + compiler for the C programming language. C does not have any audio or graphics capabilities on its own, which means that you will not find a C IDE that readily incorporates such functionality. What you need is a library with a C API that will allow you to do such things.
IIRC Turbo C did come with a rudimentary graphics library for DOS, but I do not believe that there was any support for audio. Unfortunately (or not) Turbo C is pretty much obsolete these days. Most programs written in it would have issues on modern operating systems and handling audio and graphics on DOS essentially means talking straight to the hardware - definitely not something trivial.
If you are after a modern audio/graphics library, SDL is a popular choice for 2D games and, from my experience, rather easy to work with. You will probably need to couple it with a more modern programming environment though - I doubt Turbo C will cut it. You might want to have a look at one or more of the following for a compiler and/or IDE that will be fully functional on modern systems.:
Codeblocks
Dev-C++
Warning: this IDE has not been updated for quite some time. I have used it successfully in the past, but I would not recommend investing time and resources on it at this point.
Mingw32
Eclipse CDT, downloadable here
Warning: Eclipse is mostly targeted to professional developers. It is very powerful, but it can occasionally be rather confusing to use. While it will save you a lot of time in the long run, it may not be perfectly suitable for someone that needs to get work done right here, right now.
Visual Studio Express

Resources