www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Simple tutorial

reply Daniel White <twinbee41 skytopia.com> writes:
I am new to D, but would sing its praises to the hilt if I eventually used it
over C/C++.

To start, I would like to make a simple window where I can load an image (using
the standard Windows load window), and where I can use a simple slider at the
top to change the brightness of the loaded image. (the image would update on
the fly as I altered the slider) Really simple, but uses GFX, and GUI
components. Bear in mind that I want to manually change the pixel values myself
(we can store all 24 bit pixels in a x*y*c array), and I want them updated and
lightning speed.

I want the best/fastest extensions that will allow me to make this program
using D. Can anyone recommend which ones to use, and also if there's already a
tutorial anywhere which will allow me to make something similar from absolute
scratch. How would such a setup compare to the fastest way to do it in C? 

I like to use a basic text editor for coding, rather than a bloated developer's
enviroment.
Jul 25 2007
next sibling parent reply "Craig Black" <cblack ara.com> writes:
A german guy named Matthias Thurau did some simple tutorials on installing D 
and installing D with various IDE's: http://d.whosme.de  These are the 
simplest D tutorial I have found.  He also has a tutorial on how to install 
Derelict although I don't think that will help in your case.  As far as GFX, 
I've never heard of it.  Is it a GUI library?  Anyway, if it's written in C, 
then it can be called from D.

"Daniel White" <twinbee41 skytopia.com> wrote in message 
news:f87rs0$1oja$1 digitalmars.com...
I am new to D, but would sing its praises to the hilt if I eventually used 
it over C/C++.

 To start, I would like to make a simple window where I can load an image 
 (using the standard Windows load window), and where I can use a simple 
 slider at the top to change the brightness of the loaded image. (the image 
 would update on the fly as I altered the slider) Really simple, but uses 
 GFX, and GUI components. Bear in mind that I want to manually change the 
 pixel values myself (we can store all 24 bit pixels in a x*y*c array), and 
 I want them updated and lightning speed.

 I want the best/fastest extensions that will allow me to make this program 
 using D. Can anyone recommend which ones to use, and also if there's 
 already a tutorial anywhere which will allow me to make something similar 
 from absolute scratch. How would such a setup compare to the fastest way 
 to do it in C?

 I like to use a basic text editor for coding, rather than a bloated 
 developer's enviroment. 

Jul 25 2007
parent "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Craig Black" <cblack ara.com> wrote in message 
news:f883hl$270i$1 digitalmars.com...
 As far as GFX, I've never heard of it.

GFX means "graphics" :)
Jul 25 2007
prev sibling next sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Daniel White" <twinbee41 skytopia.com> wrote in message 
news:f87rs0$1oja$1 digitalmars.com...
 To start, I would like to make a simple window where I can load an image 
 (using the standard Windows load window), and where I can use a simple 
 slider at the top to change the brightness of the loaded image. (the image 
 would update on the fly as I altered the slider) Really simple, but uses 
 GFX, and GUI components. Bear in mind that I want to manually change the 
 pixel values myself (we can store all 24 bit pixels in a x*y*c array), and 
 I want them updated and lightning speed.

 I want the best/fastest extensions that will allow me to make this program 
 using D. Can anyone recommend which ones to use, and also if there's 
 already a tutorial anywhere which will allow me to make something similar 
 from absolute scratch. How would such a setup compare to the fastest way 
 to do it in C?

Have a look at DFL: http://www.dprogramming.com/dfl.php It's a very easy-to-use Windows forms library (I get the impression you're using Windows; DFL only supports Windows right now). It comes with several example programs to get you started. That page also has a link to Entice Designer, a form designer that's a lot like Visual Studio's (though much less bloated). Entice is slowly evolving into a lightweight IDE as well.
 I like to use a basic text editor for coding, rather than a bloated 
 developer's enviroment.

Had a look at www.context.cx? Or do you already have something that you're comfortable with?
Jul 25 2007
parent reply Daniel White <twinbee41 skytopia.com> writes:
That seems great actually. Would it rival using the speed
that you would gain from using Microsoft Visual Studio
GUI components?

Also, what would you recommend for the graphics?
Is SDL a good choice? Bear in mind I want blazing
fast pixel access/display.

Cheers,
Dan

Jarrett Billingsley Wrote:

 "Daniel White" <twinbee41 skytopia.com> wrote in message 
 news:f87rs0$1oja$1 digitalmars.com...
 To start, I would like to make a simple window where I can load an image 
 (using the standard Windows load window), and where I can use a simple 
 slider at the top to change the brightness of the loaded image. (the image 
 would update on the fly as I altered the slider) Really simple, but uses 
 GFX, and GUI components. Bear in mind that I want to manually change the 
 pixel values myself (we can store all 24 bit pixels in a x*y*c array), and 
 I want them updated and lightning speed.

 I want the best/fastest extensions that will allow me to make this program 
 using D. Can anyone recommend which ones to use, and also if there's 
 already a tutorial anywhere which will allow me to make something similar 
 from absolute scratch. How would such a setup compare to the fastest way 
 to do it in C?

Have a look at DFL: http://www.dprogramming.com/dfl.php It's a very easy-to-use Windows forms library (I get the impression you're using Windows; DFL only supports Windows right now). It comes with several example programs to get you started. That page also has a link to Entice Designer, a form designer that's a lot like Visual Studio's (though much less bloated). Entice is slowly evolving into a lightweight IDE as well.
 I like to use a basic text editor for coding, rather than a bloated 
 developer's enviroment.

Had a look at www.context.cx? Or do you already have something that you're comfortable with?

Jul 26 2007
parent Tomas Lindquist Olsen <tomas famolsen.dk> writes:
On Thu, 26 Jul 2007 10:52:07 -0400, Daniel White wrote:
 
 Also, what would you recommend for the graphics? Is SDL a good choice?
 Bear in mind I want blazing fast pixel access/display.
 

SDL is not a good choice as you can't integrate it with DFL. Also you cannot have "blazing fast" pixel access and display at the same time. Either you have the pixels in system memory and the access/manipulation is pretty fast, or you have them in video memory where blitting is really fast. You can't have both as far as I know. Of course I could be wrong, if so then I'd be very interested in knowing about it! -Tomas
Jul 26 2007
prev sibling parent reply "somebody" <nospam nospam.com> writes:
Daniel White wrote:

 I like to use a basic text editor for coding, rather than a bloated
 developer's enviroment.

I'm new to the D language but I have been trying Zeus for Windows and it is a great editor. It even has a classes view. http://www.zeusedit.com/
Jul 25 2007
parent reply Jussi Jumppanen <jussij zeusedit.com> writes:
somebody Wrote:

 I'm new to the D language but I have been trying Zeus for Windows
 and it is a great editor. It even has a classes view.

I'm glad you like it ;) FYI with a bit of configuration it is also possible to run the ddgb debugger from within Zeus: http://www.zeusedit.com/ddgb-beta.html Jussi Jumppanen Author: Zeus for Windows
Jul 25 2007
parent reply "somebody" <nospam nospam.com> writes:
Jussi Jumppanen wrote:

 FYI with a bit of configuration it is also possible to run 
 the ddgb debugger from within Zeus:

Wow that's awesome! I wish I could design DFL forms in it. That would be a dream.
Jul 26 2007
parent Alexander Panek <a.panek brainsware.org> writes:
somebody wrote:
 Jussi Jumppanen wrote:
 
 FYI with a bit of configuration it is also possible to run 
 the ddgb debugger from within Zeus:

Wow that's awesome! I wish I could design DFL forms in it. That would be a dream.

Isn't Entice enough for you? :)
Jul 28 2007