flat assembler
Message board for the users of flat assembler.

Index > Windows > simple GUI for a program

Author
Thread Post new topic Reply to topic
alessandro95



Joined: 24 Mar 2013
Posts: 62
alessandro95 18 Dec 2013, 15:44
I am currently writing a chess program for a school project so I need to make a simple interface (showing the board and moving the pieces mainly), I looked some openGL and directX tutorials but they seems pretty complicate so I was wondering if there's an easier way to do it, considering that I only need some simple 2D graphics.
I am using a 64 bit version of windows 7 right now, but I can also use linux if.it.makes things easier.

Thanks in advance for your help!
Post 18 Dec 2013, 15:44
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 18 Dec 2013, 16:01
if you can write a chess engine I assume that the interface mechanics are a piece of cake. You are probably wondering how to display/manipulate bitmaps on the screen?
PS: please post the engine. Is it bitbased? If you make it UCI compliant (via stdin/stdout) you can use one of the many GUI out there like arena.
Post 18 Dec 2013, 16:01
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1622
Location: Toronto, Canada
AsmGuru62 18 Dec 2013, 17:07
So, you're coding Chess game in FASM? or C?
Post 18 Dec 2013, 17:07
View user's profile Send private message Send e-mail Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 18 Dec 2013, 17:47
I'm assuming that alessandro is coding it in fasm because it is easier (and because this is a fasm forum).
Post 18 Dec 2013, 17:47
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 18 Dec 2013, 18:49
Gdi+
As far as I recall it is bit based also.
Post 18 Dec 2013, 18:49
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 18 Dec 2013, 18:56
Basic 2D stuff can be achieved with the usual setpixel, moveto(ex), lineto(ex), polydraw, bitblt gradientfill etc and friends. Depends if you've got images or drawing "raw".
Post 18 Dec 2013, 18:56
View user's profile Send private message Reply with quote
alessandro95



Joined: 24 Mar 2013
Posts: 62
alessandro95 18 Dec 2013, 19:50
I was a bit in a hurry when I wrote my previous post (and I'm not a native english speaker) so let me explain a bit better:

I decided to write a chess engine as a school project which is something I've never done before, but there's plenty of documentation available and I have some experience with similar stuff so I didn't find big problems understanding how a chess engine works.
What is troubling me is the graphical part, because I have never coded any GUI, since I've never been interested in it, I know that openGL (and directX) are widely used so I thought they could be the right place to start from and I looked at some tutorials, what I meant isn't that I cannot understand the basics of openGL but that they look complicate enough to wonder if there's an easier solution since I don't need very complex graphic.

@AsmGuru62: I have no restiction from my school on the language I should use, but I was thinking to do it in FASM, also because my knowledge of C is pretty bad.

@tthsqe: I haven't started to code the actual engine yet, I've only been playing with move generation and such in Lua (because it is the least verbose and fastest to code language I know without worrying about the actual implementation, which is good if I only need to understand concept without caring for speed), so I haven't decided the details yet, I was planning to focus on making a working engine first and optimizing it later (I have time until June), but I'll be happy to post and discuss the code as soon as I have something worth posting!
Arena sure looks nice, but doing the GUI by myself was part of the "challenge", I'll look into it anyway.

@cod3b453: I mainly need to plot images (bitmaps?) so typedef's suggestion seems to be what I was looking for, but I have to read the docs now and see what can I do with it!

thanks to everyone by the way!
Post 18 Dec 2013, 19:50
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 18 Dec 2013, 20:20
alessandro, I wouldn't waste time on writing a gui. It is not very interesting, and there are many out there that are much better than anything one could cook up in a few weeks. The gui will be hard at first but then quickly get boring. The engine, however, will not be subject in this way to diminishing returns. I would concentrate on writing the engine as a 64 bit console app that follows the UCI protocol. Then, you can hook it up to your favorite gui and have it play against other engines (like stockfish).


Last edited by tthsqe on 18 Dec 2013, 20:39; edited 1 time in total
Post 18 Dec 2013, 20:20
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 18 Dec 2013, 20:30
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:01; edited 1 time in total
Post 18 Dec 2013, 20:30
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 18 Dec 2013, 20:34


Description:
Download
Filename: uci.zip
Filesize: 8.35 KB
Downloaded: 232 Time(s)

Post 18 Dec 2013, 20:34
View user's profile Send private message Reply with quote
HaHaAnonymous



Joined: 02 Dec 2012
Posts: 1178
Location: Unknown
HaHaAnonymous 18 Dec 2013, 20:41
[ Post removed by author. ]


Last edited by HaHaAnonymous on 28 Feb 2015, 19:01; edited 1 time in total
Post 18 Dec 2013, 20:41
View user's profile Send private message Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1622
Location: Toronto, Canada
AsmGuru62 18 Dec 2013, 20:50
@alessandro95:
I am great with GUI, but I have no idea about the chess engines -- never tried to write one.
Post 18 Dec 2013, 20:50
View user's profile Send private message Send e-mail Reply with quote
alessandro95



Joined: 24 Mar 2013
Posts: 62
alessandro95 18 Dec 2013, 21:29
tthsqe thanks for the documentation, I didn't know about the UCI protocol, I'll read about it carefully next week (winter holidays), also using a pre-existing GUI doesn't sound bad since it is the least interesting part to code by myself
Post 18 Dec 2013, 21:29
View user's profile Send private message Reply with quote
fatygant



Joined: 12 Sep 2011
Posts: 30
Location: Poznan, Poland
fatygant 20 Dec 2013, 10:55
alessandro, take a short look here: http://www.madwizard.org/programming/tutorials/mosaic/

this is the wonderful masm32 assembly programming tutorial where you are creating a mosaic game. chess board is not that far away from mosaic (just a little bit bigger) - I guess you can grab a lot from that project to make your chess gui.

good luck!
fatygant
Post 20 Dec 2013, 10:55
View user's profile Send private message Reply with quote
tthsqe



Joined: 20 May 2009
Posts: 767
tthsqe 09 Jan 2014, 13:20
How is this project progressing? Have you implemented all of the rules? Move generation? Search?
Post 09 Jan 2014, 13:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.