Page 1 of 2

Posted: Sat Sep 14, 2002 7:16 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi Fred!, Hi @ all!
If you want to code an intro, game or something where you need fast graphic blittings you will of course use DirectX...

BUT what if you want draw only some boxes, circles or whatever to your application/GUI... Did we really need DDrawLib which need DirectX to draw any stuff to an application???

In fact of this i would preffer to have maybe two drawing libs or one drawing lib (splitted in GDI and DX drawing)... So we can use GDI drawings for our appz/GUI like "Plot()" "Line()" i.e. and "DX_Plot(), DX_Line() for DirectX drawings!!!

Whats your opinion?


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sat Sep 14, 2002 11:18 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

I don't know why other functions are needed. Actual functions just need to be optimized for directX and it will be ok, exactly like the Plot() one.

Fred - AlphaSND

Posted: Sun Sep 15, 2002 1:29 am
by BackupUser
Restored from previous forum. Originally posted by tranquil.

MrVain? I dont know one applications that uses DirectX!? Or do I need to install DirectX for Excel or Word?

DirectX is designed for gaming and multimedia or did I misunderstand something here!? :)

Cheers
Mike

Tranquilizer/ Secretly!
http://www.secretly.de
Registred PureBasic User

Posted: Sun Sep 15, 2002 3:31 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi Fred
Sorry, maybe you misunderstand something or my sentence wasnt clear enough!? You are right to optimize some functions for faster drawings i.e. for game development where guys would use DirectX!

But my idea was to use and have standard standalone GDI drawing functions for pure applications only (not for setup of games or such a stuff) !!!

Just explain an user that he need to have DirectX installed to run your calculator application for example, where you want draw some stuff to the GUI (GraphicUserInterface)...

Or as Tranquil said... have you ever seen an application like Word, Access, Excel... where you need DirectX???? We just need DirectX independent (also GDI drawing) functions in PureBasic! Thats exactly what i mean...

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Sep 15, 2002 3:34 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

the 2Ddrawing commands dont need DirectX installed.

cya,
...Danilo

(registered PureBasic user)

Posted: Sun Sep 15, 2002 3:41 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi Danilo
I thought the PureBasic 2D DrawingCommands are DirectX based and optimized for game coders!? So those commands are not real DirectX based when i can use it on DirectX screen and on my application window!? I only know to use GDI for drawing stuff on a window/application...

How what way is PureBasic using when drawing to a screen or to a window? In both ways GDI!? Can someone clear and explain this please to understand...??

PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Sep 15, 2002 7:05 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

Code: Select all

OpenWindow(0,10,10,300,300,#PB_Window_SystemMenu,"Draw")
 
Repeat
   Select WaitWindowEvent()
      Case #PB_EventCloseWindow: End
      Case #WM_PAINT
           StartDrawing( WindowOutput() )
              DrawingMode(1)
              FrontColor($00,$00,$FF)
              Line(0,0,300,300)
              FrontColor($FF,$FF,$00)
              Locate(150-TextLength("LOL @ Mr.Vain :wink:")/2,140)
              DrawText("LOL @ Mr.Vain :wink:")
           StopDrawing()
   EndSelect
ForEver
cya,
...Danilo :)

(registered PureBasic user)

Posted: Sun Sep 15, 2002 10:42 am
by BackupUser
Restored from previous forum. Originally posted by tinman.

I think MrVain was asking about the fact that you can use Plot() on a window (using GDI?), and also a screen (which uses DirectX). If the plot command is not used on a screen (BTW tranquil, I'm using DirectX in an app :wink: does PB still open the DirectX library or not?



--
It's not minimalist - I'm increasing efficiency by reducing input effort.
(Win98first ed. + SP1, PB3.30)

Posted: Sun Sep 15, 2002 11:07 am
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.

Hi Danilo
looool back @ you... i always know how to draw any simple stuff to a window!!! The topic was not "How to draw on a window" ... it is "GDI vs DirectX drawing"...!!!

When i draw any stuff with the 2D DrawingLib to a window, i dont need DirectX??? Then please explain me following... The 2D DrawingLib is used by some people for game development and as i thought until now, the 2D DrawingLib is complete DirectX based!?

If so, how can i draw to a window with the same commands i use in a game i.e. - but in my app those commands dont require DirectX, if the same command require DirectX in my game!?! A little bit crazy...

Are there internal two versions of any command like Plot()? One for fast DirectX drawings on screens and one GDI based to draw on windows/GUI!? Else i cant really understand the system (onetime i hear you need DirectX and in the next second i hear you dont require DirectX to draw stuff... Please tell me whats now correct....

PS
Es gibt keine blöde Fragen... nur blöde Antowrten!! Und es ist auch noch KEIN meister vom himmel gefallen!





PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Sep 15, 2002 11:42 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

I think the 2Ddrawing commands are GDI only
and work on every Windows - even without DirectX.

IMO DirectX is needed as soon as you use the
SCREEN and SPRITE libraries.
And maybe the commands like Plot() test internally
before they draw. If StartDrawing() is ScreenOutput()
it Draws directly into the DirectX surface, otherwise
it draws by using GDI.

Fred can answer this question for sure. (Fred?)

Try the following source on a PC WITHOUT DirectX installed:

Code: Select all

;
; ---[ PLAIN GDI - no DirectX or Screen Routines ]---
;     \__________>-= Danilo * 2002 =- 280: moveflag = 1: EndIf
           Else
              circleX - Speed
              If circleX  20: pingflag = 1: EndIf
           ElseIf pingflag = 1
              ping - 1: If ping  255: boxcolor = 255: boxcolorflag = 1: EndIf
           Else
              boxcolor - 5: If boxcolor < 50: boxcolor = 50: boxcolorflag = 0: EndIf
           EndIf
           degree - 1
           If degree = 0: degree = 360: EndIf
  update_in_progress = 0
EndProcedure
 
StartTimer(1,20,@Update())
 
HideWindow(0,0)
While WindowEvent(): Wend
 
Repeat
   oldtime = TimeGetTime_()
   Select WindowEvent()
      Case #PB_EventCloseWindow: End
      Case #PB_EventGadget
           Select EventGadgetID()
             Case 1
                  Speed = GetGadgetState(1)
             Case 2
                  SinCurveY = GetGadgetState(2)
             Case 3
                  SinCurveX = GetGadgetState(3)
             Case 5
                  EndTimer(1): CloseWindow(0): Delay(50): End
           EndSelect
      Case #WM_LBUTTONDOWN
           EndTimer(1): HideGadget(6,0): While WindowEvent(): Wend
           SendMessage_(hWnd,#WM_NCLBUTTONDOWN, #HTCAPTION,0)
           HideGadget(6,1): StartTimer(1,20,@Update())
   EndSelect
 
PaintIt:
   If update_in_progress = 0
      StartDrawing(WindowOutput())
         DrawImage(ImageID(),0,0)
      StopDrawing()
   Else
      Goto PaintIt
   EndIf
   While TimeGetTime_() - oldtime < 20: Delay(1): Wend  ; 1000 / 20 = 50 frames / sec
ForEver
I really _think_ this is the way you could do plain GDI game coding:
draw on an image and blit (drawimage) it on the Window... TRY IT.

cya,
...Danilo

(registered PureBasic user)

Posted: Sun Sep 15, 2002 11:58 am
by BackupUser
Restored from previous forum. Originally posted by Danilo.

I forgot to mention:

The REASON i think 2DDrawing is GDI, is simply
that you can use the 2DDrawing commands with
Images, Windows, Screens, Printer...

This sounds 100% like GDI for me.

good night,
...Danilo :)

(registered PureBasic user)

Posted: Sun Sep 15, 2002 12:09 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
Danilo wrote:
I think the 2Ddrawing commands are GDI only
and work on every Windows - even without DirectX.

And maybe the commands like Plot() test internally
before they draw. If StartDrawing() is ScreenOutput()
it Draws directly into the DirectX surface, otherwise
it draws by using GDI.

Fred can answer this question for sure. (Fred?)
Hi Danilo and Fred:
Yes, thats exactly what i think atm too... I mean, that all the 2D drawing commands are still GDI only and not really DirectX based as you said!? But as i remember right, Fred told me that the 2D drawing commands are complete DirectX based and not by using GDI and handling the drawn stuff later as DX image or however...!?

So i only want to know, does we have only GDI drawing support in PureBasic atm (for screens and windows), or does we have real DirectX drawings in PureBasic too!? Fred, maybe you should add and explain this FAQ to the 2D drawing helpfile!!

Fred, are there internal two functions (GDI and DX) for any 2D drawing command and how do you handle this when creating an executeable!? Will you find two versions/functions (GDI and DX) in the executeable (independetn of InitSprite() or not!?

Is the 2D drawing lib splitted in GDI and DX or splitted in any own command? Thanks in advance...


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Sep 15, 2002 12:15 pm
by BackupUser
Restored from previous forum. Originally posted by MrVainSCL.
Danilo wrote:
The REASON i think 2DDrawing is GDI, is simply
that you can use the 2DDrawing commands with
Images, Windows, Screens, Printer...

This sounds 100% like GDI for me.
Hi @ all
If the stuff with GDI and drawing shoule be right... does it make no sence to have in future version special DirectX only based drawing commands for very fast drawings in our DX based games??? Commands like "DX_Plot()" i.e. !?


PIII450, 256MB Ram, 6GB HD, RivaTNT, DirectX8.1, SB AWE64, Win2000 + all Updates...

greetz
MrVainSCL! aka Thorsten

Posted: Sun Sep 15, 2002 12:57 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

Ok, let's clarify. The 2DDrawing() library is object oriented (internally) which means than functions used can totally different depending on the output. All 'normal' output use GDI as danilo said, as it work everywhere. Nevertheless, if a ScreenOutput() is used, then the plot() command is changed to the DirectX one, without the user know. So it's a flexible (and easy) API which use the fastest way depending to output.

Currently, only Plot() is accelerated for DX to allow realtime effects (like plasma one, MrVain :). Some other commands will follow. But the programmer willn't have to change its code, just to compile it with the new compiler version to have accelerated commands. I hope I've been clear enough...

Fred - AlphaSND

Posted: Sun Sep 15, 2002 12:58 pm
by BackupUser
Restored from previous forum. Originally posted by fred.

And DirectX is NOT used in regular output (window, image, printer etc...)

Fred - AlphaSND