About this blog
My thoughts, opinions and updates on my final year project for University.
Entries in this blog
What do you think?
Only a quick update today...
I have finished the first write of my error logging system. This is more of an appendage to the error handler in that it gets handed errors by the handler and writes them to the output file.
For the first time i have used Doxygen to dynamically create the documentation for the project. For those of you unfamiliar with it (as i still very much am), Doxygen scans all of the C++ documents in a given directory and looks for comments in the styles it recognises. With these it compiles documentation into HTML pages.
I have used it for the first build of the docs and now i am going through and adding brief comments to all necessary parts of my work.
Have a good day all,
During my latest session of GUI programming i have been working out whether or not to cater for multi-byte as well as Unicode. Unicode is pretty much a must nowadays, especially for me during this project because i want to support multiple languages in the GUI.
The conclusion i have arrived at is both multi-byte and unicode should be supported. This is because of the multi-language support and also because the GUI is targeted at beginner programmers who may not be fully aware of what Unicode is.
As well as all this unicode business i have also been working on the error reporting and handling procedures. I have decided, with help and advice from others, that the best way of doing it is to always report an error via a code to a GUI-wide first_error variable. This allows easy retrieval via the accompanying function:
Along with this i have also provided the method:
-UseExceptions( bool val )
This allows the user to specify whether they wish for exceptions to be thrown on top of the normal error logging. All exceptions thrown are of type GUIException, which is derrived from std::exception. GUIException is given the description of the error.
I have devised a system where, as a pre-build step for the library project, i run another small program. This program takes a text file that contains a listing of all the error codes along with brief description and writes a pair of C++ files, errorstring.h & .cpp. These then get compiled into the GUI library and contain an array of std::string's along with a function for accessing a string at a given index. This enables me to provide a reference to the user of all the error messages and their associated codes and at the same time keep the library code easily updated with the latest error messages that have been added. The user can also 'look up' the description associated with an error code by using the method:
-GetErrorString( Int code );
- Error logging to file or otherwise
- Geometry instancing code
- DirectX Renderer
- and lots, lot's more
Well that's all for today!
In my opinion its been long since i have found an arcade game completely addictive. Recently i was introduced to Albatross 18, a great FREE golf game, japanese style.
The idea is that you start off with a generic character called Scout. Each character has certain attributes:
As you play rounds of golf on any one of the 8 courses of varying difficulty you earn a play-money called Pang. The more of this you earn the more you can upgrade the attributes and therefore the more special shots you can make to in turn earn more pang.
It's in full 3D and is really solidly made, i recommend it to anyone.
Here is a screenie of me putting:
If you decide to give it a go, invite me as a buddy on the game, my username is PutterDave. The i can give you a few lessons.
Well it has been freakin ages since i posted anything here and so i thought it was about time to.
Recent times has been littered with starting and not finishing small projects. This has mainly been because i have been busy with uni work.
For those of you that don't know, i am reading Computing for Real Time Systems. This is a very code heavy degree. I have put into practice something along the lines of 7 or 8 different languages:
- 2 or 3 ASMs - For various embedded environments.
- Java - Interface with hardware using JNI to simulate lifts and house security.
- JSP - Used with java to give a web interface to the same simulations.
- PHP - Stand alone websites, purely for learning the language.
- SQL - Used in conjunction with PHP for obvious reasons.
- C - I was strong in this already, used as the HLL for embedded devices.
- C++ - I was strong in this already. Did this for learning OO.
- VHDL - Designed a simple CPU in software, produces schematics.
So as you can see i've been hella busy doing all this for my 3rd year. The results of this being that i passed everything, well the uni screwed me over by losing some of my coursework, so that is down as a fail despite having actually passed it.
All this has kept me from finishing the simple example of a memory manager i was writing up. I didn't realise but i had generated a bit of interest in it so i apologise for letting down those of you who were waiting for further updates. I am sorry to say that i am discontinuing for the time being because i have much more important work to begin with.
This important work is my final year project for year four of my degree. The plan, although not officially stated to uni, is to write a GUI library for DirectX and OpenGL application writers. From what i have seen there are only a few solid GUIs currently available and i believe they are not so simple to integrate into your application.
This is where my GUI aims to excel. I want it to be trivial to overlay onto your application. This ofcourse is only a simple proposition, i need to write alot of design documents before i'm truely ready to concrete any plan.
I had decided to write a GUI a good 2-3 months ago, basically towards the end of last semester and so over the summer i wrote the core components of a very basic GUI. I learned an awful lot about writing GUIs from this.
Here is a screenie of the GUI i bodged together:
I got as far as draggable windows within windows and buttons. The DirectX logo there is an imagecontrol indie the window.
Well my final year project GUI has been started and is taking shape, nothing to show for it yet though. I have used solid unit testing using CPPUnit for the first time in this project, so that is taking a bit of getting used to.
Well i will *try* to keep this updated regarding my GUI over the next few months,
Well i have made a solid start to my memory manager and all is looking well. At this moment it does nothing more than simply divert the implementation of both 'new's and 'delete's to a class and track the total bytes allocated.
I'll keep you posted.
Firstly i would like to welcome people back to my jounal, which hasn't been edited in a long time.
1) Had alot of uni work to get done, which incidentally has been going better than last year.
2) Had nothing to write about!
So here goes:
I have started work on a memory manager which will be presented to you guys for beta testing some time in the near future. I am still getting to grips with the concepts but my knowledge and prior experience with C++ is already paying dividends. This topic requires full knowledge of the language since it deals with alot of lower level code and syntax horrors.
As you guys may or may not know i have more interest in writing low level code and complex constructs with C++, also complex algorithms, so this is right up my street.
Right now ( 123 am ) i am considering an all nighter to get started on this but i have climbing tomorrow and im kinda stoned so guess i should sleep. I have also been eating cheese which has left me a little queezy.
Ehem, back off the tangent, i will begin work on the manager tomorrow afternoon/evening before my houses new drinking game called the, well, Timesplitters Drinking Game. Original huh?
Well i will be seeing you and check back here for more random garble.
I havnt posted in my journel for a while because i have had so much university work to do. Sadly this has also inhibited my progress with my current projects. However i have continued developing DynamicVertexBuffer and have produced a document describing its operation.
I hope you can make use of this.
Well take care all and im not sure when ill be able to update this again since i have exams coming up now.
Just a quick post, ive been very busy with lots of things, trying to earn money. This my coding hasn't budged since i last posted.
Sadly i can't report any advance on THUD or Simon Says since uni and farm and social have got in the way and i havnt had time. The only thing i have achieved is a complete rewrite of the dynamic index and vertex buffers so these are now fully functional and ready for release, if need be.
Time allowing i will push forward the design phase of simon says and get the UML completely sketched.
Hi, long time, no update.
Sadly i been so busy with uni work i havmt' had time to post anything here, but i've found 5 minutes so...
Umm, in any spare time ive had i have been perfecting my DynamicVertexBuffer and DynamicIndexBuffer classes. I seeked architectural advice from my C++ lecturer at uni and now i think they are finished. They appear to work perfectly as well, which is nice.
I am going to produce full-blown online manual pages and offline help files, as well as tutorials and source snippets.
Keep checking back for further updates.
Ok so writing THUD has given me alot of experience with 2D GUI design, even though THUD isnt finished.
I have decided to apply THUD to a simple game called Simon Says.
I will report back soon.
Not much work has been done on THUD of late cos Uni work has been stepped up a gear.
Ok so alot of work is being done on auto_vb at the moment, fine tuning.
I have also decided to provide an STL compliant iterator and const iterator so that u can sort vertices using STL. I have seeked professional advice on the structure of auto_vb and what's been said has been made note of and so a few adjustments will be made.
Namely i was advised that it would seem a more natural syntax to use += and + instead of > is the best way to extract vertices from the buffer. This would make > a matching syntactical pair, this being better in my opinion. I have also considered that accessor syntax might be better if i followed in the steps of STL by using push and pop_back. This may not be such a good idea since rarely is it important to have specific vertices at the front or back. Any opinions?
I also plan to reveal an even futher managed vertex buffer. This one will also have the built in functionality of indexing (note: i am yet to fully design this so it may end up not being feasable).
The concept behind this is that u can add vertices to the buffer in groups and an index keeps track of the groups. You can apply a descriptor for the group, like the texture that will be applied. this will then give you the ability to sort the groupings of vertices by texture. The new auto_vb would then be able to optimise by concatenating groups of vertices together, if you wish, in order to improve performance.
Well thats the update.
Any feedback would be appreciated.
Ok, so ive finally revamped auto_vb and it seems to be working fine, but i still need some people to integrate it into some code properly to pick up any last problems.
Also if u have any ideas for further functionality it should have, in ur opinion, then please let me know and i'll build it in.
Well i hope i can get some feedback from you :).
As i have just mentioned in the below post i have written auto_vb.
I intend to wrap other parts of the DirectX API and also make them available on free.
- LPDIRECT3DVERTEXBUFFER9 (indexed)
Ok so ive been working hard on a template wrapped vertex buffer.
This item has come along very nicely and appears quite robust now and should be available to download in a short while.
The features of this item are as follows:
Name : auto_vb
Description: Is a wrapper for a DirectX Vertex Buffer and through careful management of memory acts as a scalable vertex buffer. Simply when u add more vertices to an already full buffer, or one that doesn't have quite enough room, it will make a new one of appropriate size for you. It also make sure your data remains intact. You are able to add vertices to auto_vb in many ways. You can stream vertices in using >. You can concatenate two auto_vb object together using the binary operator +. The operator overloads are done in similar fashion to the std:streams which means you can link streaming together for input to the buffer. You can add by passing arrays to a Write() function, passing an std::vector or by a single vertex. You can also specify it to create it of a specific size, rather than the size of what is passed to it in other modes of instantation.
It keeps track of the size and capacity of the buffer which is very useful since u need this value when it comes to using DrawPrimitive() etc.
A SetProps() method needs to be called and needs to have a properties struct passed to it post creation only if u create using the default constructor otherwise this struct must be passed in with the data to be stored.
Well the code quality is pretty good and im looking for people to test it and give me feedback. So if you would like a copy of the source to either read through or to test in your own projects then please reply here with ur email address and ill mail it off. Although if you wait it will be available from my site.
This item will be bundled with the THUD API i am writing, so it will be available for download with that.
The auto_vb.h file has a text at the top saying more or less what i have said here and also contains details for contacting me. It also has a brief code snippet to give u and idea of how to use it.
Well if you have taken time to read this, then thanks and i will look forward to any feedback i get.
The font engine is being left as is and so is the THUD scenegraph.
I am currently writing a new wrapped vertex buffer component for THUD. This is going to be very similar to the wrapped vertex buffer except that this time the vertex buffer will have an index with it.
You will still only be able to store one type of vertex in it but u will be able to fill it with vertices that require different textures on screen. The index, which will be a vector can be sorted by texture and then when it comes to rendering, u step through the vector rendering the parts of the VB as indicated.
(BTW this is an idea fresh of about 5 mins ago so if you spot any flaws please say here)
If this vertex buffer proves fast and usable enough i will likely encorperate the Font renderer and the thud component render into 1.
Most of the font engine for thud is now done.
So over the last day or so i have been optimising the 2 main renderers giving them that little more speed.
Just a short note today really, plenty more features to implement.
More progress has been made with the THUD font engine that is currently being worked on. The font engine has now got built in '\n' support and Custom Proportion Adaptation.
The first meaning that you can specify:
"I wrote this program\nDavid Lovegrove"
and the engine will wrap the text to the next line as shown in the pic here.
The second meaning that u can scale and position it customly :).
As you can see it is making progress but the quality of the actual font isnt that good. The one produced from the tool i'm using appears to produce off center characters, so thats about as good as it will get without another tool.
There are two more features that i plan to add to the font engine either now or in the near future.
a) Equation Manipulation, i would like it to be possible for the user to provide a simply equation for the text. Like a simple vector or even a parabola.
b) Auto-paragraphing. Its a preset property of the text descriptor that u can set paragraph borders, This is not yet implemented but will be in due course.
Well i finally, after working out a complicated algorithm, have encoded font widths into the font engine. When u register a font set texture to the font engine the engine also looks for a .INI file which contains the character width data. If this data is not available it reverts to standard quad spacing.
The font engine will come witha few default available fonts.
Over the past few days ive been coding a font engine as a component to THUD.
It currently prints out text with even spacing which looks aweful. Im working on variable spacing which will make the text look far better.
Over the past few days my social life has got in the way of pushing this project forward, but a little got done.
I managed to get the mouse control of the Component_Box_Draggable sharper but still 1 issue with it to be resolved. That issue is the ability of the user to start the drag outside of the box and push the box around.
I have made available two demos of THUD at its beta stage.
Boxes and Buttons
These two executables are using a basic kernel and do not enumerate devices etc. DirectX 9 MUST be installed.
Please help with feedback, thankyou.