LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-08-2018, 12:54 AM   #1
deleted23
Member
 
Registered: Nov 2015
Distribution: Arch, Ubuntu Studio
Posts: 43

Rep: Reputation: 1
Graphics in terminal, GnuPlot etc


Day

I program in C/C++ and Assembler and I am NOT (not -anymore- and at all) interested in either Windows or Linux GUI-API's!

I'm not very good at it but not really extraordinary bad either.

Actually I am thinking about a project in which I want to display real-time data in x/y coordinates in a terminal-window under Linux.
Are there still people using Windows?

I took a look at GnuPlot but that's not what I am looking for. It's already too abstracted!

I need a reference to literature (or even better sample application(s)/code) which explains to me how to direct modify the framebuffer in a way where I can

a.) display the chosen data (lets say) in the top right corner of the terminal-window AND
b.) constantly having a command-line at the bottom of the window OR
c.) even better have several plots at different coordinates in the terminal-window while still having a stdin at the bottom. (or wherever else)

by either modifying the framebuffer itself and direct (resp. the driver(s)) or MUCH BETTER by the help of X's Extensions. I.e. Xinerama for multi-monitor support etc.

Please only comment if you know what you are doing and if you can deliver sophisticated, qualified and proofed content. I am already 'unqualified enough' to listen (or read) even more unqualified stuff of which is out there enough.

The last time I posted here I got exactly what I was looking for in short so I am curious what happens this time.


Thanks for your consideration.

Greets
Gee
 
Old 03-08-2018, 01:16 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,664
Blog Entries: 6

Rep: Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525Reputation: 2525
You have already pointed yourself in the right direction with the X libs and extensions, and you should find lots of online reference documentation for that.

You might also find SDL to be of value. I have not programmed using SDL but it is a widely used graphic library popular for gaming applications. SDL uses OpenGL, which is probably the core functionality that you need based on your description.

If you are running in an X environment, then writing to the framebuffer directly is probably not what you want.

Also...

Quote:
Originally Posted by bluntroller View Post
Please only comment if you know what you are doing and if you can deliver sophisticated, qualified and proofed content.
While others here are always willing to help, if you are looking for others to provide you with complete, tested code, this isn't the right place to ask. Usually the best starting point is to show others what you have tried so far and what is or is not working for you. Asking for "proofed" code before showing your own efforts is generally frowned upon.

Please see the Site FAQ for guidance in acceptable forum participation.

Last edited by astrogeek; 03-08-2018 at 01:18 AM. Reason: Added SDL link
 
1 members found this post helpful.
Old 03-11-2018, 06:50 PM   #3
deleted23
Member
 
Registered: Nov 2015
Distribution: Arch, Ubuntu Studio
Posts: 43

Original Poster
Rep: Reputation: 1
@ Astrogeek:

Sorry for the delayed reply.
I was 'island-hopping' for a few days and had limited internet-access.

Thanks for your input which I appreciate A LOT and will try to comment briefly.

I took a glimpse at SDL.
Quite overwhelming ('again') and probably too much to 'scour' ('again') to come to useful results...

Quote:
While others here are always willing to help, if you are looking for others to provide you with complete, tested code, this isn't the right place to ask.
Why?
The internet is full of source-code - you just need to know where.

Quote:
Usually the best starting point is to show others what you have tried so far and what is or is not working for you.
I haven't coded anything yet because I am too busy with either IT related or other things.
Time is precious to everybody of us and that's the reason of my intention to post here.
Honestly I am usually not interested to ask for unnecessary help.
I rather try to avoid it.

Also is coding something 'from scratch' a no-brainer.
People who do that are (in my opinion and without insulting anybody) a bit 'beside the track' and have probably a 'profile problem'.

Quote:
Asking for "proofed" code before showing your own efforts is generally frowned upon.
Well, I have here Methyl Sacylate Camphor mixed with Menthol my gf uses to rub my right shoulder and sometimes my head...
Perhaps it helps...
:-)

I am looking for source-code and work in C which I can modify for my needs.
Coding from scratch is the last option I take.

See https://tfetimes.com/wp-content/uplo...15/04/hack.pdf

Steve Quallines C++ Hackers Handbook Hack 2, Page 12 -- Let Someone Else Write It





Some further interesting readings:
----------------------------------

https://stackoverflow.com/questions/...cs-programming

https://elinux.org/DirectFB




Cheers
Gee

Last edited by deleted23; 03-11-2018 at 07:31 PM.
 
Old 03-11-2018, 09:08 PM   #4
scasey
Member
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.4
Posts: 981

Rep: Reputation: 333Reputation: 333Reputation: 333Reputation: 333
Quote:
Originally Posted by bluntroller View Post
I am looking for source-code and work in C which I can modify for my needs.
Coding from scratch is the last option I take.
As someone who's been "coding from scratch" for all of my 45+ year career, I have this advice:

Issue an RFQ with your requirements. Be prepared to pay someone to do the work you need done.

Just sayin'
 
1 members found this post helpful.
Old 03-12-2018, 12:07 AM   #5
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,153

Rep: Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273
Two maintained framebuffer apps that I know about are w3m (which includes a framebuffer-supporting w3m-img component and sounds like a particularly good example) and fbi. Both come with source code.

Your actual requirements though, all say "ncurses" to me.

Quote:
I program in C/C++ and Assembler and I am NOT (not -anymore- and at all) interested in either Windows or Linux GUI-API's!

...

Actually I am thinking about a project in which I want to display realtime data in x/y coordinates in a terminal-window under Linux.

...

a.) display the chosen data (lets say) in the top right corner of the terminal-window AND
b.) constantly having a command-line at the bottom of the window OR
c.) even better have several plots at different coordinates in the terminal-window while still having a stdin at the bottom. (or wherever else)
You didn't say that the the "plots" had have a graphical resolution finer than a character, so yeah. ncurses for all of the above.

Also: do you actually need to use the framebuffer? If you just want to display images in a terminal window: most X-based or Wayland-based terminal emulators actually support that. xterm actually has particularly good support for it.

Last edited by dugan; 03-12-2018 at 12:25 AM.
 
1 members found this post helpful.
Old 03-12-2018, 03:02 AM   #6
deleted23
Member
 
Registered: Nov 2015
Distribution: Arch, Ubuntu Studio
Posts: 43

Original Poster
Rep: Reputation: 1
Thumbs up An A for Dugan

@scacey:
Yeah you are probably right. Thank you.

@dugan:
nice appreciate!

Quote:
You didn't say that the the "plots" had have a graphical resolution finer than a character, so yeah. ncurses for all of the above.
Yes, the plots have to be finer than a character so poking in just a dot here and there doesn't cut it.
You can think of it as a x/y plot of bandwidth-data with 1-dot granularity, free positioning (i.e.), an update frequency of about 200ms and an iddle-loop for commands at the bottom.

Which open source program does have similar characteristics? (without using a higher level API)

Last edited by deleted23; 03-12-2018 at 05:26 AM.
 
Old 03-12-2018, 06:09 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 8,413
Blog Entries: 5

Rep: Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047Reputation: 2047
Quote:
Originally Posted by bluntroller View Post
Which open source program does have similar characteristics? (without using a higher level API)
erm. dugan just told you?

while i appreciate the pointlessness of reinventing the wheel, it now starts to look more like asking for handouts.

you said yourself, the internet is full of useful GPL'd code => flex those finger muscles and start typing some search queries!
unzip some tarballs and see what they actually contain!
 
1 members found this post helpful.
Old 03-12-2018, 09:46 AM   #8
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,153

Rep: Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273
Quote:
Originally Posted by bluntroller View Post
Yes, the plots have to be finer than a character so poking in just a dot here and there doesn't cut it.
Well, how else would you draw the graph?

"poking in a dot just here and there" is literally how graph-drawing is done.

You are aware of that, right?

Because at this point, I'm actually not sure if you know that.

Quote:
You can think of it as a x/y plot of bandwidth-data with 1-dot granularity, free positioning (i.e.), an update frequency of about 200ms and an iddle-loop for commands at the bottom.
So a live-updating status indicator, like you'd use for industrial equipment? Only running in a terminal, with graphical graphs?

Nothing that I can think of.

What kind of data is this going to be plotting, btw? If it is for industrial equipment, then bugs in your work can cost lives.

Last edited by dugan; 03-12-2018 at 05:10 PM.
 
1 members found this post helpful.
Old 03-13-2018, 03:24 AM   #9
deleted23
Member
 
Registered: Nov 2015
Distribution: Arch, Ubuntu Studio
Posts: 43

Original Poster
Rep: Reputation: 1
@Slackware:

Thanks for your reply again.
Yes, I am aware of how it works but haven't dealt yet with the framebuffer direct but instead either with the WinAPI or GTK where it is actually quite an easy procedure etc.
But I want to avoid using the libraries but hardcode all in C.
And... I know sources where to copy code-fragements.
I just wanted to hear alternatives known to other users here.

However, actually I am looking for a button to delete my account here and can't find none.
Is there any chance one of you can forward this request to an adminstrator as I am not able to send personal messages too.

I'd really appreciate it.
Please dismiss me from the duty to explain my decision.

Kind regards

Peter
 
Old 03-13-2018, 09:10 AM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: Slackware
Posts: 8,153

Rep: Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273Reputation: 3273
Quote:
Originally Posted by bluntroller View Post
However, actually I am looking for a button to delete my account here and can't find none.
Is there any chance one of you can forward this request to an adminstrator as I am not able to send personal messages too.
This place has a hard policy of not deleting accounts that have made posts.

https://www.linuxquestions.org/quest...count_deletion
 
1 members found this post helpful.
  


Reply

Tags
fbdev, framebuffer, xinerama


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gnuplot postscript terminal RudraB Linux - General 3 01-04-2013 07:48 AM
gnuplot svg terminal problem sreejithpk Linux - Software 6 03-18-2009 11:24 AM
GNUPLOT and graphics algoritms (need help) ~Linux_user~ Linux - Software 1 02-04-2008 08:41 PM
no x11 terminal in gnuplot 4.0.0 polzbert Linux - Software 1 01-10-2006 04:54 AM
gnuplot cant detect terminal trylinux Linux - Software 3 02-17-2005 04:02 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration