C - Non-obtrusive graphics library? [closed] - c

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I've used GUI's in other languages but never a low language like C. I've looked online and found that SDL is the ideal choice but unfortunately I don't like the fact that it runs within a window of it's own. Is there any way to just draw directly to the screen without any other features?
For example, if I wanted to draw a shape that stays ontop of other windows, but is not just a stage that has its property set to transparent.
If that's not possible, then I'm looking for something as simple and as hassle free as possible. My goal is to create something like this

Is there any way to just draw directly to the screen without any other features?
This depends on what environment you run in, but in general: No, if you're running on a system with some kind of display management (you are, unless you forgot to mention you're doing bare-bone graphics on some microcontroller.) someone has to assign you a kind of window to do drawing.
For example, if I wanted to draw a shape that stays ontop of other windows, but is not just a stage that has its property set to transparent.
As said, you'll need someone to give you a buffer to draw on. And that's exactly what a window is.
If that's not possible, then I'm looking for something as simple and as hassle free as possible. My goal is to create something like this
SDL & OpenGL, or really: Use some game/3D engine.

Related

Plotting a graph in C (ubuntu) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
i would like to ask a question,because i have been searching for 2 hours.
I have a project in a game development course and i have arrays of some map elements,positions,and lines that connect them.And i need to draw a graph from them.But I don't have the slightest idea.Do i include some header file?
Do i download that? If i had the commands i could work with that,but i don't see graphics command anywhere in code blocks.
Please inform me on what i can use to draw a simple graph,and possibly the installation process in general if it's not too much trouble
There is no such a thing as a "graphics command" somewhere in Code::Blocks. In order to create graphical interfaces and to be able to draw things, you have to use a GUI library (like GTK, Qt, SFML, wx... etc).
Since your requirement is to use C I'd recommand you then to go with GTK. Since it's one of the best and most documented library with C language at it's base.
Note: Please be careful that what I mentioned above are only GUI libraries, i.e. mainly used to create graphical user interfaces. Since you are following a game development course, you may rather want to take a look at game engines such as SDL or Unity, which are quite different things, and enable to perform a lot more (serious) gaming stuff.
Here's a Wikipedia list with a thorough listing of GUI libraries.

How to count pipes from the image? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I would like to count objects (pipes) from this photo:
Can you help me and give me a general idea of how it should be done? I'm still a beginner and have no previous experience in processing images like this. I've googled it and found something called OpenCv but couldn't go anywhere from there.
If the pipes are always red - take only the red channel from the RGB image.
Have you tried hough transform? It will detect the circles (pipe holes).
You can tweak it a bit to detect elipses as well.
Another approach is to invert the colors of the image and use connected components analysis. The dark holes surrounded with brigth color is an excelent feature
You can also train a classifier on the red channel. Try built in openCV boosted detectors (should be relatively good even with HAAR features. Look at the example of training face detectors. openCV has all the code ready. You just have to cut manually examples of pipe holes.

How do I create a multiform GTK App [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Hi I have been playing around with C and Gtk trying to learn a thing or two
Now wondering how do I create an application that has more then one form.
Do I just clear the window out or do I create new windows every time I want to have another form or view.
and does anyone know a good place to learn this type of thing?
I assume your goal is to use one window but change (large parts of) the window contents at times?
The widget you are looking for is GtkStack, which is a container that will only show one of its children at a time. You can use a Stack with user visible controls (StackSwitcher) or from your own code.
The Stack was only added in 3.10, so in earlier GTK+ versions you'll need to do the work yourself: Add your "forms" as children of a Box and make sure only one child is shown at a time.
does anyone know a good place to learn this type of thing?
To find out what kind of widgets you have at your disposal, I suggest reading the fine manual: https://developer.gnome.org/gtk3/stable/.

Build an interface using only the SDL and the C standard library [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need to make a program using only the C standard library and the SDL. I can't use the Windows API or any other library. I need to use only the C language i.e. no C++, no C# etc.
I have really no idea on how to achieve that since I only know to output to the standard output device (console) and files. So I hope you can give me an example on how to open a window with two buttons (custom built): one to exit and one to perform any task.
To create a window: https://wiki.libsdl.org/SDL_CreateWindow?highlight=%28%5CbCategoryVideo%5Cb%29%7C%28CategoryEnum%29%7C%28CategoryStruct%29
About the buttons, you gotta compare the mouse coords and if the user is clicking on the desired spot to do whatever you want. To get this user input data you gotta use the sdl event handling system. You can learn about it trought sdl's wiki or you check this tutorial http://lazyfoo.net/SDL_tutorials/lesson04/index.php (i'm sure that there are other tutorials out there if you google it).
To draw the buttons to the sccreen you have to use SDL's rendering system.
Your question is not that specific, so that is the best i can do for you.

Build a GUI Application for Windows in C [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I'm fairly new to C programming.
My program is running at the console as expected, but now I want to build a really simple Windows GUI application for it, sticking to C (just a window showing some text and a file menu).
So far, I have built everything in a single .c source code and used MinGW gcc in my Windows PC as the compiler.
I just downloaded Visual Studio 2013, but trying to use it was a bit overwhelming. I tried to look for alternatives but I'm confused with all the terminology (IDE, SDK, API etc.) and what I really need to do what I want to.
I'll be really satisfied if you just point something for me to read in order to clear my mind.
Thanks a lot in advance and sorry if this was a bad question.
A very simple GUI application is possible sticking with C and Windows API only.
In short, you have to register your own Window class (RegisterClassEx), then create the window (CreateWindowEx). Note that your window class main element is its (WindowProc) that receive the messages and that you have to implement to act as you want. After that, your C program should run the message pump (PeekMessage and DispatchMessage) for Windows to do its stuff and allow interacting with your window.
See the MSDN documentation for these functions to get help and examples.
YOu can start learning GTK for developing GUI using C language . you can get the same at
http://www.gtk.org/development.php

Resources