Thread: [Dev-C++] some more to Graphics
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: <ste...@ge...> - 2000-12-27 23:27:59
|
oh, and also... I would like to know about page-flipping/buffering in = 640x480?? |
|
From: Elias P. <Eli...@ao...> - 2000-12-27 23:52:30
|
oh, and also... I would like to know about page-flipping/buffering in = 640x480?? If you want to know the difference to 320x200, it is basically the same. = Only, in 320x200 you don't need page-flipping because you can update all = the pixels on the screen fast enough to get smooth animation without it. Page flipping is a technique to create smooth graphics movement. = Basically, you 'buffer' the data to be displayed, and only when they are = ready, they are displayed. For example, if you make an animation where a = circle moves over a background, you will use an 'offscreen-page' or = 'back-buffer' where you first draw the background, then the circle over = it, and then display it. While it is displayed, you (invisibly) draw the = background on the next offscreen page, then the circle on it, and then = swap both pages, so the new one gets displayed. Now you draw the next = animation frame on the first page, and so on... the same is used for = more complex animations like in 3d games. The advantage is that the = watcher of the program never sees how the background and the circle are = drawn, so it looks like there is a smooth animation. (as long as you = flip new pages at least about 30 times per second) I'm not sure how you can tell a DOS program to do this. I'm using the = DOS-Allegro library where i have a function show_video_page to do the = page-flipping, or DirectX where you have Surface->Flip or something = similiar depending on the version. Elias Pschernig |
|
From: Vesa N. <wa...@dl...> - 2000-12-28 00:00:51
|
Hi, Someone asked about page flipping in SVGA modes. This can be done by playing around with the view position. The screen is a 640x480 viewport into 640xwhatever screen, which can be hardware-scrolled vertically. You can draw to 0-480 while showing 480-960 and vice versa for example. The view location is a BIOS call. I don't remember it by heart but look at VESA2.0 specs and you'll find it easily. -Vesa |
|
From: <ste...@ge...> - 2000-12-28 20:39:04
|
Oh, well... that's sound kinda cool.
I'm doing something like this in my programs;
unsigned char *VGA =3D (unsigned char *) MK_FP(0xA000, 0);
unsigned char *BUFF =3D NULL;
BUFF =3D new unsigned char[64000]; 320x200 =3D 64000
draw_stuff_to_buff( );
__fmemcpy(VGA, BUFF, 64000);
So, is there anyone who has something to use for some kewl and fast =
graphics for games in min. 640x480. I'm using Turbo C++ 3.0
Thanks!
----- Original Message -----=20
From: Elias Pschernig=20
To: dev...@li...=20
Sent: Wednesday, December 27, 2000 3:52 PM
Subject: Re: [Dev-C++] some more to Graphics
oh, and also... I would like to know about page-flipping/buffering =
in 640x480??
If you want to know the difference to 320x200, it is basically the =
same. Only, in 320x200 you don't need page-flipping because you can =
update all the pixels on the screen fast enough to get smooth animation =
without it.
=20
Page flipping is a technique to create smooth graphics movement. =
Basically, you 'buffer' the data to be displayed, and only when they are =
ready, they are displayed. For example, if you make an animation where a =
circle moves over a background, you will use an 'offscreen-page' or =
'back-buffer' where you first draw the background, then the circle over =
it, and then display it. While it is displayed, you (invisibly) draw the =
background on the next offscreen page, then the circle on it, and then =
swap both pages, so the new one gets displayed. Now you draw the next =
animation frame on the first page, and so on... the same is used for =
more complex animations like in 3d games. The advantage is that the =
watcher of the program never sees how the background and the circle are =
drawn, so it looks like there is a smooth animation. (as long as you =
flip new pages at least about 30 times per second)
I'm not sure how you can tell a DOS program to do this. I'm using the =
DOS-Allegro library where i have a function show_video_page to do the =
page-flipping, or DirectX where you have Surface->Flip or something =
similiar depending on the version.
Elias Pschernig
|
|
From: Elias P. <Eli...@ao...> - 2000-12-28 21:32:25
|
If you want to do a graphics application, there are some reasons = (hardware-acceleration, 32bit support, support for libraries...) why i = would suggest you to switch to another compiler (Dev-C++ of course, or = at least DJGPP). But anyway, if you are using Turbo C++, didn't it come = with a graphics library ? If i remember right it is the library with the = .BGI drivers - i think you can get a driver for VESA (for 640x480x256 = mode), and then just use setactivepage() and setvisiblepage() functions = to do page flipping. Oh, well... that's sound kinda cool. I'm doing something like this in my programs; unsigned char *VGA =3D (unsigned char *) MK_FP(0xA000, 0); unsigned char *BUFF =3D NULL; BUFF =3D new unsigned char[64000]; 320x200 =3D 64000 draw_stuff_to_buff( ); __fmemcpy(VGA, BUFF, 64000); So, is there anyone who has something to use for some kewl and fast = graphics for games in min. 640x480. I'm using Turbo C++ 3.0 Thanks! |
|
From: <ste...@ge...> - 2000-12-28 22:10:58
|
Thanks alot, I think I'll try it out! :-)
But, where can i find help to get started with dev-cpp, because I can't =
make it work so far. It's like you have to know which files to include =
'n stuff.
Where can i find help to get started with some really kewl =
game+graphics-programming in (fx. dev-cpp), maybe even with some kewl =
stuff like DirectX, OpenGL and Direct3D.
Well, I hope you guys got some cool things for me.
Thanks, 'n ceep coding! :-)
----- Original Message -----=20
From: Elias Pschernig=20
To: dev...@li...=20
Sent: Thursday, December 28, 2000 1:32 PM
Subject: Re: [Dev-C++] some more to Graphics
If you want to do a graphics application, there are some reasons =
(hardware-acceleration, 32bit support, support for libraries...) why i =
would suggest you to switch to another compiler (Dev-C++ of course, or =
at least DJGPP). But anyway, if you are using Turbo C++, didn't it come =
with a graphics library ? If i remember right it is the library with the =
.BGI drivers - i think you can get a driver for VESA (for 640x480x256 =
mode), and then just use setactivepage() and setvisiblepage() functions =
to do page flipping.
Oh, well... that's sound kinda cool.
I'm doing something like this in my programs;
unsigned char *VGA =3D (unsigned char *) MK_FP(0xA000, 0);
unsigned char *BUFF =3D NULL;
BUFF =3D new unsigned char[64000]; 320x200 =3D 64000
draw_stuff_to_buff( );
__fmemcpy(VGA, BUFF, 64000);
So, is there anyone who has something to use for some kewl and fast =
graphics for games in min. 640x480. I'm using Turbo C++ 3.0
Thanks!
|
|
From: Elias P. <Eli...@ao...> - 2000-12-28 23:12:17
|
Do you get Dev-C++ not working at all, or do you just not get it to = compile programs. In any case, there should be some error message which = might help finding out why it doesn't work. For OpenGL and DirectX, there are lots of documentation and tutorials = around - but i can't suggest any because i am instead using a 2D game = programming library called Allegro (www.allegro.cc). It also works in = DOS with the DJGPP compiler. Thanks alot, I think I'll try it out! :-) But, where can i find help to get started with dev-cpp, because I = can't make it work so far. It's like you have to know which files to = include 'n stuff. Where can i find help to get started with some really kewl = game+graphics-programming in (fx. dev-cpp), maybe even with some kewl = stuff like DirectX, OpenGL and Direct3D. Well, I hope you guys got some cool things for me. Thanks, 'n ceep coding! :-) |
|
From: <ste...@ge...> - 2000-12-28 23:41:57
|
Wow... 8-) Well, I have started downloding the newest version of dev-dpp right this = instant. Last time at used it I only managed to compile simple = console-programs which wrote a stupid message or somthin'. As soon as I = bagan to compile bigger programs, it seemed as if the commands should be = wrote different from what I used to do in Turbo C++ 3.0. Well, should = they be more or less the same? I really would like to get started on som = game-programming for windows! Isn't there alot of advantages? I mean, = more memory, newest graphics-units, Direct-stuff etc.? I have once or = twice taked a look at some windows-programs but I really don't know = where to start. There is an enourmous amount of commands like = "WIN_API_something" and "OpenWINdow", and stuff like that. I don't know = what the heck it means. It would be nice with an article about some = programming for windows for extreme beginners, or something. Where do I = start, and what do I do? Oh, 66% of DevCpp4.zip downloaded... hehe, I can't wait to see if I = figure out something kewl with it. After all I do like the program it = self an the interface and so on. :-) Thanks - Stein Nyg=E5rd ----- Original Message -----=20 From: Elias Pschernig=20 To: dev...@li...=20 Sent: Thursday, December 28, 2000 3:12 PM Subject: Re: [Dev-C++] some more to Graphics Do you get Dev-C++ not working at all, or do you just not get it to = compile programs. In any case, there should be some error message which = might help finding out why it doesn't work. For OpenGL and DirectX, there are lots of documentation and tutorials = around - but i can't suggest any because i am instead using a 2D game = programming library called Allegro (www.allegro.cc). It also works in = DOS with the DJGPP compiler. Thanks alot, I think I'll try it out! :-) But, where can i find help to get started with dev-cpp, because I = can't make it work so far. It's like you have to know which files to = include 'n stuff. Where can i find help to get started with some really kewl = game+graphics-programming in (fx. dev-cpp), maybe even with some kewl = stuff like DirectX, OpenGL and Direct3D. Well, I hope you guys got some cool things for me. Thanks, 'n ceep coding! :-) |
|
From: Ioannis V. <no...@ya...> - 2000-12-29 00:53:47
|
I am still in the phase of learning C++ (currenly reading Bjarne Stroustrup's Special Edition) so i only know console stuff and so on, but keep in mind that another disadvantage of free-to-download-from-borland turbo c++ is that it is not supporting the official ANSI C++ standard, the STL, and many other things, so you are in great language disadvantage. That is, you are missing key language facilities which provide many solutions for everyday demanding tasks, you have to reinvent the wheel in many cases, and face language restrictions which were solved by the ANSI standards committee and even face compiler bugs and restrictions which were solved by later versions of the compiler. If i remember well turbo c++ 3 is more than a decade old (the official ANSI C++ standard came out 1998) so i guess you are missing key facilities such as exception handling, templates, e.t.c.. On the other hand Dev-C++ comes equipped with last version of GCC (late 1999 release) which is the best free compiler available (or one of the best). If you want to use a Borland's compiler i suggest you download the *latest* release of Borland C++ 5.5 which is free to download and extremelly good. I suggest you also take a look at Bjarne Stroustrup's pages at the following link (he is the creator of C++): http://www.research.att.com/~bs/ Ioannis P.S.. GCC (Dev-C++ also supports Objective C). -----Original Message----- From: dev...@li... [mailto:dev...@li...]On Behalf Of Stein Nygεrd Sent: Friday, December 29, 2000 10:41 AM To: dev...@li... Subject: Re: [Dev-C++] some more to Graphics Wow... 8-) Well, I have started downloding the newest version of dev-dpp right this instant. Last time at used it I only managed to compile simple console-programs which wrote a stupid message or somthin'. As soon as I bagan to compile bigger programs, it seemed as if the commands should be wrote different from what I used to do in Turbo C++ 3.0. Well, should they be more or less the same? I really would like to get started on som game-programming for windows! Isn't there alot of advantages? I mean, more memory, newest graphics-units, Direct-stuff etc.? I have once or twice taked a look at some windows-programs but I really don't know where to start. There is an enourmous amount of commands like "WIN_API_something" and "OpenWINdow", and stuff like that. I don't know what the heck it means. It would be nice with an article about some programming for windows for extreme beginners, or something. Where do I start, and what do I do? Oh, 66% of DevCpp4.zip downloaded... hehe, I can't wait to see if I figure out something kewl with it. After all I do like the program it self an the interface and so on. :-) Thanks - Stein Nygεrd ----- Original Message ----- From: Elias Pschernig To: dev...@li... Sent: Thursday, December 28, 2000 3:12 PM Subject: Re: [Dev-C++] some more to Graphics Do you get Dev-C++ not working at all, or do you just not get it to compile programs. In any case, there should be some error message which might help finding out why it doesn't work. For OpenGL and DirectX, there are lots of documentation and tutorials around - but i can't suggest any because i am instead using a 2D game programming library called Allegro (www.allegro.cc). It also works in DOS with the DJGPP compiler. Thanks alot, I think I'll try it out! :-) But, where can i find help to get started with dev-cpp, because I can't make it work so far. It's like you have to know which files to include 'n stuff. Where can i find help to get started with some really kewl game+graphics-programming in (fx. dev-cpp), maybe even with some kewl stuff like DirectX, OpenGL and Direct3D. Well, I hope you guys got some cool things for me. Thanks, 'n ceep coding! :-) |
|
From: jag <won...@th...> - 2000-12-29 01:00:19
|
i hear on my travels allegro is a really good library for games = programming in C++. I've been experimenting with euphoria a simple = programming language, the guru's of euphoria even tried to do some = wrappers of allegro so it works with it too. =20 I'm slowly coming over to C++ now though and i have the same problems as = stein in that i am really a novice first tackling the software before = getting into the language. Hope i make some headway though! Do you know of any allegro tutorials or stuff? thanks jag ----- Original Message -----=20 From: Elias Pschernig=20 To: dev...@li...=20 Sent: Thursday, December 28, 2000 11:12 PM Subject: Re: [Dev-C++] some more to Graphics Do you get Dev-C++ not working at all, or do you just not get it to = compile programs. In any case, there should be some error message which = might help finding out why it doesn't work. For OpenGL and DirectX, there are lots of documentation and tutorials = around - but i can't suggest any because i am instead using a 2D game = programming library called Allegro (www.allegro.cc). It also works in = DOS with the DJGPP compiler. Thanks alot, I think I'll try it out! :-) But, where can i find help to get started with dev-cpp, because I = can't make it work so far. It's like you have to know which files to = include 'n stuff. Where can i find help to get started with some really kewl = game+graphics-programming in (fx. dev-cpp), maybe even with some kewl = stuff like DirectX, OpenGL and Direct3D. Well, I hope you guys got some cool things for me. Thanks, 'n ceep coding! :-) |