• Advertisement
Sign in to follow this  

Guys Can I Ask You Something?

This topic is 4687 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well i have a basic app framework i wrote that gets me started on DirectX applications quite quickly. It: - Wraps window creation - Wraps D3D device creation - Provides an application loop in a Finite State Machine style So my question is: If you have written your own app framework that you use regularly to get urself started, what does it do ( in terms of how i have said above ). If you havnt written one what basic features of a framework would you like to see in something you may use. Note that by framework here i mean the bare essentials, nothing special. Nothing like a scenegraph. Well if u can provide any insight it would be greatly appreciated. The reason for my question is that i have learned new deisgn patterns and have come up with new ideas so i would like to rewrite it. Thanks, ace

Share this post


Link to post
Share on other sites
Advertisement
heh.

I dont really have a framework yet. so right now i just copy paste teh code for getting a windows window out. And go from there. Mostly becouse of school and after school i already have a few projects so i dont really need to create new projects again. aka no need for framework.


happy? *pats ace_lovegrove on the head*

Share this post


Link to post
Share on other sites
No, you can't ask us anything. From this moment on your question asking privileges have been revoked. Consider this your last and only warning.

Share this post


Link to post
Share on other sites
Quote:
Original post by ace_lovegrove
Well i have a basic app framework i wrote that gets me started on DirectX applications quite quickly.

It:

- Wraps window creation
- Wraps D3D device creation
- Provides an application loop in a Finite State Machine style


Win32 and DirectX are the only API's I've used where this is necesary. Using SDL, the things you mention require only ~5 lines of code for 2D, and even if you are doing 3D with OpenGL it only takes ~20 tops.

So I have no real need for a framework.

Share this post


Link to post
Share on other sites
Heh, I was going to reply, but couldn't form a good reply so early in the morning...

Anyways, I don't have a framework per se, but here are the things I migrate from project to project these days:

- A rendering system.

This is similar to the device wrapper you describe, but also sets up a scene graph sort of thing [although only for 2d]. Allows for generic keybinding and text input. Does image loading/rendering, text rendering, a drop down console, some simple lists, some simple particle effects.

This only does generic "display image here", "display text here" sort of things, and defines a unified interface to render objects. The actual game builds off of and uses this basis.

- A timer setup.

Just simple time triggered events.

- A [terrible] logger.

Which can be used in place of the drop down console for output.

- A server/client text networking class.

Because setting up buffering and connection handling each game is tedious.

The actual windows initialization code is cut/pasted as needed.

Share this post


Link to post
Share on other sites
Quote:
Original post by ace_lovegrove
Well thanks for the replies, greatly appreciated.


errm.. it was only like 2hs between your inital post and you complaining, its not out of the ordinary for posts to go 5 or 6 hours without getting a reply, so complaining after only two when you havent asked a specific question just for insights makes you seem a bit.. well.. whiney.

As for the orignal question, i've got a whole library setup for making and controlling windows which i use in every OpenGL program I make and another lib with some simple helpper functions in as i got sick of copy and pasting them around the place. As the main loop in all my test programs just needs to work the message pump after window creation and setup all i ever have is a while loop which checks to see if the window has been closed and then quit if so.

Share this post


Link to post
Share on other sites
Quote:
Original post by _the_phantom_
errm.. it was only like 2hs between your inital post and you complaining, its not out of the ordinary for posts to go 5 or 6 hours without getting a reply, so complaining after only two when you havent asked a specific question just for insights makes you seem a bit.. well.. whiney.


hmm maby he is just bored or lonly or both?




Share this post


Link to post
Share on other sites
I wrote (and rewrote several times) a little library. It handles creating an openGL window, or creating a rendering context in a control. It has no message loop or anything, I pass it the WNDPROC when I call it. Basically just saves me typing of all the window and opengl init stuff. It also has a vector class, and the beginning of a matrix class.

Share this post


Link to post
Share on other sites
Thanks for the replies, i was narked because i was either losing at Counterstrike or had a bad beat at poker, i apologise.

Ace

Share this post


Link to post
Share on other sites
I have a very basic engine which could be considered a "framework" for easily and quickly creating new applications.

It includes input functionality as well as sound, cameras etc on top of the system-orientated features such as windows etc and hardware capabilities.

The way I have implemented it is in a heirachical inheritance structure, letting me overload the base classes with a more specific set and therefore extend the functionality without altering the original codebase - but then I admit to being a bit of an inheritance addict.

[S]

Share this post


Link to post
Share on other sites
I have a custom gui library framework that I sometimes use. Because it requires a project to be setup a certain way (exceptions enabled, rtti, certain libraries and include directories) one of the things I did that minimised re-typing and errors was to create a custom VS.net wizard.
So I can click New "Chaos library project" and it gives me all my code and settings all ready to rock.

Only did this about a week or two ago, but I'm really impressed with the flexibility offered by VS.net's extensibility model.

Share this post


Link to post
Share on other sites
My framework's pretty awesome. It opens a window with a textbox in it, asks the user to describe the game they want to play, and then writes and compiles the game on-the-fly.

Share this post


Link to post
Share on other sites
I write my framework as I need it, then refactor it as I go for other projects or elegance. Most of the time, YAGNI. That being said, I consider a framework an important step towards achieving optimum code clarity, because often the intent of code can get lost behind the dozens of system calls.

My abstractions generally aren't the greatest the first time I'm working through a problem. When I come back and refactor, I do a much better job, simply because:
1. I'm not trying something "just to see if it works"
2. I know more about the problem than I did originally

Share this post


Link to post
Share on other sites
Generally Pong is the first application I create when working with a new graphics library. So, I guess you could say that's my application framework.

Share this post


Link to post
Share on other sites
Quote:
Original post by antareus


My abstractions generally aren't the greatest the first time I'm working through a problem. When I come back and refactor, I do a much better job, simply because:
1. I'm not trying something "just to see if it works"
2. I know more about the problem than I did originally


Heh, isn't that the "products aren't really stable until 3.0" effect? I know it takes about 3 runs through something for me to really make something non-trivial decently.

Thankfully I'm getting much better at compartmentalizing things so that only maybe 200 lines need re-written each time, rather than 2000.

Share this post


Link to post
Share on other sites
I got around to make a framework some time ago already. I had one using GDI (windowed)/DDraw(fullscreen) and one using DX8. Both handle window creation, setting up, toggling window mode, sound and input.

I made a custom setup wizard, so i just choose project type 2d or 3d and get going.

Last year i felt that the one framework set to use DX8 was a bit constraining as for updated DX version and i built a new framework using abstract interfaces via DLLs. I also put the sound into a DLL (later i'll probably do the same to the input system). Now i can choose with a configurator which renderer and sound class i want to use. I've got currently DX8, DX9 and a half-assed OpenGL version going.

Also, inspired by the Pop Cap Framework i build another framework specialised on 2d games able to use 3d acceleration, but with a fallback to 2d without loosing any features. This last framework is also able to change between 3d acc and 2d on the fly.

The abstracting learn me some nice new tricks and i'm pretty happy with it. Also, the custom app wizard feature of VS is very neat, although the non-existant documentation on the friggin HTML/javascript-based wizards isn't exactly helpful.

Prepare for a lot of frustration when the wizard stops running because there's an error inside and then searching that damn bug.

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
Heh, isn't that the "products aren't really stable until 3.0" effect? I know it takes about 3 runs through something for me to really make something non-trivial decently.

That is overstated a bit.

1.0 may be as stable as you can make it at the time, but many of us have very little experience building software from scratch, so 1.0 may be our first swim in some murky waters. I'm in the middle of doing an engine rewrite for my application, and managed to slash the amount of code necessary in half at least. Most member functions are much smaller than before, and I'm a lot better about ensuring they do *one* thing only. Refactoring has different goals in mind than the initial implementation, so I am far more picky about nomenclature, code purity, etc. Not to mention, I have learned quite a bit compared to when I first wrote it (last year).

When it comes to design, I'm up to revision 18 or so probably. That is another discussion. :)

Share this post


Link to post
Share on other sites
Heh, that's paraphrase of an old quote by someone [relatively famous] regarding enterprise software. I'll need to track down that quote now...

Share this post


Link to post
Share on other sites
I usually just copy and paste code out of my other projects. I try to keep everything as modular as possible, so I can just drop in my window base code, vertex buffer classes, D3D device setup code, etc.

Share this post


Link to post
Share on other sites
vertex buffer classe?

I wrote a managed vertex buffer class, is that what urs is?

ace

Share this post


Link to post
Share on other sites
Quote:
Original post by ace_lovegrove
vertex buffer class?
It's just a class that wraps the creation, (un)locking and lost device info. It's most useful for dynamic VBs, because it returns the next chunk of data in the VB, so you don't need to keep track of what's been used in your VB.
I did have a version of the class that did some buffer checking in debug mode (much like how the CRT checks allocations when you free them), but I seem to have misplaced it.

Share this post


Link to post
Share on other sites
I wrote mine so that you dont have to worry about resizing the VB and IB, it will resize it for you maintaining the data, and it also fits into DP calls easily as well.

You up for swapping code?

ace

Share this post


Link to post
Share on other sites
VertexBuffer.h
VertexBuffer.cpp

I don't actually have a class for index buffers, but it wouldn't be a lot of work to convert the VB code to use IBs. I'll try to find the old vertex buffer code I had (which did a bit of debug managment) later on.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement