LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 06-01-2014, 05:59 AM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Rep: Reputation: 255Reputation: 255Reputation: 255
Is Windows 3.1 compiled on SDL?


Hi,

I would like to know on which libraries is likely compiled Windows 3.1? Might it be SDL?
(nobody might knows since it is closed, from Microsoft)

Regards
 
Old 06-01-2014, 07:22 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by Xeratul View Post
I would like to know on which libraries is likely compiled Windows 3.1?
the early evolution of Windows is closely related to that of OS/2; some people claim they even share parts of the same codebase, which is plausible because Microsoft and IBM worked closely together on the first versions of OS/2. Apart from that, it was often claimed that Windows was for the most part written in plain C and parts of it in assembly language. That would rule out C++ libraries, and of course those that appeared after 1990. Windows 3.1 was mainly a facelift of 3.0 with some re-work, especially in terms of multimedia and improved stability, but one would not assume that the programmers at MS introduced a completely new toolchain in 1992.

Quote:
Originally Posted by Xeratul View Post
Might it be SDL?
What particular meaning of SDL are you referring to?

[X] Doc CPU
 
Old 06-01-2014, 09:09 AM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Doc CPU View Post
Hi there,



the early evolution of Windows is closely related to that of OS/2; some people claim they even share parts of the same codebase, which is plausible because Microsoft and IBM worked closely together on the first versions of OS/2. Apart from that, it was often claimed that Windows was for the most part written in plain C and parts of it in assembly language. That would rule out C++ libraries, and of course those that appeared after 1990. Windows 3.1 was mainly a facelift of 3.0 with some re-work, especially in terms of multimedia and improved stability, but one would not assume that the programmers at MS introduced a completely new toolchain in 1992.



What particular meaning of SDL are you referring to?

[X] Doc CPU

thank you very much for your hints and nice information


I have found on google and here that

https://www.youtube.com/watch?v=iIfR9-aZwn4

They (MS dev) probably used the graphics.h
to draw pixels.

It is definitely nicer than SDL, in my opinion.

This is also maybe so so light, that they could manage to get very fast applications. Today so much apps are so much bloated.


Is graphics.h today cross-platform (on Linux and Windows (likely only on dosbox))?
 
Old 06-01-2014, 09:14 AM   #4
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
1) Here some nice news:
How to use graphics.h on linux.

attached

It looks so simple to use.. graphics.h

2) I meant sdl simple layer for graphics


3) why graphics.h is not popular under Linux?
it is quite light, and do not need x11 for fast applications


4) Edit:
Code:
$ gcc -lncurses -llibgraph test.c
test.c:2:21: error: graphics.h: No such file or directory
test.c: In function 'main':
test.c:6: error: 'VGAMAX' undeclared (first use in this function)
test.c:6: error: (Each undeclared identifier is reported only once
test.c:6: error: for each function it appears in.)
test.c:6: error: 'DETECT' undeclared (first use in this function)
Code:
#include<stdio.h>
#include<graphics.h>

int main()
{
int gd,gm=VGAMAX; gd=DETECT;
initgraph(&gd,&gm,NULL);
line(50,50,80,80);
delay(5000);

return 0;
}
Attached Thumbnails
Click image for larger version

Name:	graphics.h in ubuntu.jpg
Views:	32
Size:	100.0 KB
ID:	15650  

Last edited by Xeratul; 06-01-2014 at 09:19 AM.
 
Old 06-01-2014, 09:40 AM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
gcc -lgraph test.c
./a.out

http://download.savannah.gnu.org/rel...h-1.0.1.tar.gz

with test.c


Code:
#include<stdio.h>
#include<graphics.h>

int main()
{
int gd,gm=VGAMAX; gd=DETECT;
initgraph(&gd,&gm,NULL);
line(50,50,80,80);
delay(5000);

return 0;
}
is working!!!

What can I do with that now?
is lib graph useful for coding things without x11?

Is it portable to Windows, then?
 
Old 06-01-2014, 10:25 AM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
I have added those files to /usr/lib and magic !!

a68b8e4b5871c3c6f97f34359ca39731 libgraph.a
a0f934cbb9148722fe4a2f7d21b6e2e6 libgraph.la
883afa8698c9f1073cf359747bbf3408 libgraph.so
883afa8698c9f1073cf359747bbf3408 libgraph.so.1
883afa8698c9f1073cf359747bbf3408 libgraph.so.1.0.1


graphics.h is so cool!

why it is not into our repositories of debian?



Code:
#include<stdio.h>
#include<graphics.h>

int main()
{

int gd = DETECT,gm, left=100,top=100,right=200,bottom=200,x= 300,y=150,radius=50;


//int gd,gm=VGAMAX; gd=DETECT;
initgraph(&gd,&gm,NULL);

line(50,50,80,80);

line( 0, 0, 100, 100);


   rectangle(left, top, right, bottom);
   circle(x, y, radius);
   bar(left + 300, top, right + 300, bottom);
   line(left - 10, top + 150, left + 410, top + 150);
   ellipse(x, y + 200, 0, 360, 100, 50);
   outtextxy(left + 100, top + 325, "My First C Graphics Program");



getch();

closegraph();

//delay( 5000);



return 0;
}
Attached Thumbnails
Click image for larger version

Name:	superbe-graphics-lib.png
Views:	23
Size:	3.8 KB
ID:	15651  
 
Old 06-01-2014, 03:51 PM   #7
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
No Microsoft does not use "graphics.h" or SDL to "draw pixels." The pixel-blitting layer of Windows is called GDI. It was written specifically to implement Windows and is (obviously) only available on Windows.

No offence, but it's physically painful to see speculation (Does Windows use SDL? MS probably used graphics.h to draw pixels!) that's this silly.

Last edited by dugan; 06-01-2014 at 03:53 PM.
 
Old 06-01-2014, 03:53 PM   #8
Drakevr
Member
 
Registered: Jan 2013
Location: Greece
Distribution: Slackware64, openBSD
Posts: 38

Rep: Reputation: 7
His attached C code is also physically painful to see...
 
Old 06-01-2014, 03:54 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by Drakevr View Post
His attached C code is also physically painful to see...
The fact that it's obviously an uncredited copy-and-paste adds to that pain.

As does the fact that he never even bothered to find out which library "graphics.h" is part of.
 
1 members found this post helpful.
Old 06-01-2014, 04:23 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Considering that Windows 3.1 came out before the release of SDL and obviously before the release of whatever library "graphics.h" is from...
 
Old 06-02-2014, 05:29 AM   #11
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

as a matter of fact, I hadn't even known SDL as a graphics library before this thread.

Quote:
Originally Posted by dugan View Post
As does the fact that he never even bothered to find out which library "graphics.h" is part of.
The identifiers (constants and functions) being used and the semantics remind me very strongly of Borland's graphics library which was bundled with Borland C++ and Borland Pascal for Windows. That, however, originates from somewhere in the late 80's.

[X] Doc CPU
 
Old 06-02-2014, 08:45 AM   #12
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,657

Original Poster
Rep: Reputation: 255Reputation: 255Reputation: 255
Quote:
Originally Posted by Doc CPU View Post
Hi there,

as a matter of fact, I hadn't even known SDL as a graphics library before this thread.



The identifiers (constants and functions) being used and the semantics remind me very strongly of Borland's graphics library which was bundled with Borland C++ and Borland Pascal for Windows. That, however, originates from somewhere in the late 80's.

[X] Doc CPU

Thanks. The code which is into the graph (libgraph) which is made to be working on Linux is actually based on the
very old graphics.h.
It is a library code that is quite minimalist, but might allow to do some cross-platform of some various program on Windows and Linux.
It is of course completely outdated, but it remains however particularly interesting for research and some purposes.
It is slow, but very interesting if you have some particular things to do.

Comments from Dugan are to be laugh at. He gives comments on things he does not know. I would sincerely recommend him to avoid negative comments.

Of course, that I read the stuffs from the code of libgraph. I understood the purposes of it. I read the code src of libgraphics (for Linux), read all html pages in it, and also have seen that it is a work-around based on SDL.
I have a right to appreciate that graphics.h (for Linux ) is made available.

Maybe I have asked a silly question. I am sorry However have you rights to say that this is a silly question.
 
  


Reply



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
SDL cross compiled troubles emping Linux - Embedded & Single-board computer 0 06-03-2010 03:56 AM
SDL is installed, included and linked, but will not compile SDL code mansizerooster Programming 10 05-31-2006 04:18 AM
Sourcecompiling Problem...The sdl-config script installed by SDL could not be found. deepclutch Debian 1 12-15-2005 12:15 PM
Trying to program an SDL application but cannot find the SDL.h file:SuSE 9.2&KDevelop pujolasdf Linux - Newbie 4 03-13-2005 07:50 AM
Making Windows in SDL fatherg Programming 2 08-19-2004 01:43 AM

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

All times are GMT -5. The time now is 04:06 AM.

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
Open Source Consulting | Domain Registration