pouët.net

Go to bottom

C# demoes with source or other frame works

category: code [glöplog]
Hi there.

So I want to program my own scene frame work, that I can use for the demo scene and other stuff.

I first tried out c++, but I got annoyed with the language. I mean it is slow do develop in compared to python. But I also need more experience with the language in order do develop faster. Thus i looked further on.

What seems right to me is using SharpDx with C#. I want to use Directx11 with the math library and SharpDX can do that.

So I started to learn SharpDX with the emphasis on making a small framework just to have some design for flexible code.

I have been looking into finding frame works that show a good way to make a frame work design using the C# language and SharpDX, but it seems mostly that they implement the C++ way of doing thing but in C#.

So my question is. Do any one know of some SharpDX demoes with source code or other SharpDX frame works with a proper design. When I say proper I mean using SharpDX and C# correctly as they are designed for.

I did look into rastertek tutorials, but I seems to be too much for what I need.

Thank you for any help
added on the 2013-03-13 14:49:44 by MRLB MRLB
Here's a curveball: what do you expect said framework to do?
added on the 2013-03-13 15:03:06 by Gargaj Gargaj
Well I have looked at game frameworks and such.

But a demo scene frame work would be designed for demo scene and game frame work is different.

But here it the plan.
I want to make frame work I can use to make fluids with and ray tracing and demoes. This will be possible because a lot of thing are reuse like a camera and handling keyboard input.

What I currently want as a goal is to make a framework with a free cam and load obj files.

So seeing how demo are made in SharpDX or other game using SharpDX will help me to learn what sections to split directx11 into and how all the objects sends message to each other if need be
added on the 2013-03-13 15:15:14 by MRLB MRLB
Thought about trying XNA?
added on the 2013-03-13 15:33:51 by Gargaj Gargaj
You can find a source code of a game I developed with XNA at shiningsource.net.
added on the 2013-03-13 16:47:58 by Adok Adok

See if this changes your mind. It did mine.

(I assume framework == engine)

http://scientificninja.com/blog/write-games-not-engines


I'm just getting back into real-time graphics. My approach, pretty much 'raw' C wherever possible with a few, I may use C++ if things get like lists might be easier to manage.

I also use the KISS rule (Keep It Simple Stupid!) Build a library routines of ONLY functions that you use, not what you think you might use as that leads you down a road of making stuff for the sake of making stuff which may not get used, and not "actually" making stuff.

added on the 2013-03-13 17:41:20 by Canopy Canopy
Patapom made quite a nice SharpDX framework with Nuaj' :
http://www.patapom.com/topics/Nuaj/
added on the 2013-03-13 17:52:48 by MsK` MsK`
I would say Nuaj too, the code is public domain and Patapom is very helpful and knowledgeable.
added on the 2013-03-13 18:35:05 by ponce ponce
Quote:
I mean it is slow do develop in compared to python


There's nothing preventing you from writing a demo with something like pygame if you like the language. SharpDX sounds like a better alternative to me as well though...
added on the 2013-03-13 19:03:14 by Preacher Preacher
Last time I checked, pygame was very limited (like Processing <= 1.5x, probably more so). Not to mention, rather slow.

At the end of the day you probably want to invest the two or three weeks of time that it takes to write your own custom mini framework / library that has the features you want, implemented and interfaced in the way best suited for you.
added on the 2013-03-13 19:53:39 by tomaes tomaes
I think it get's clearer if you take a step back, and collect what you actually need the engine/framework to do.
For demos you need something that enables you to synchronize things to something, like music - you might want to have something that collects your effects or scenes and takes care of showing/enabling them at certain events (maybe time again).

That's the scaffolding I started with, where the "show scene a at time :32" just was a big if else - but it did the job.

I think, what needs a bit to sink in is that you won't find a engine/framework that works like you want it - however you might draw ideas from things you saw, and build upon that.
Another advice is, to just start coding - try something you think that works - and then refactor/throw away and redo. I've yet to meet someone who still uses their first engine/fw :)

Good luck on your journey, you'll sure learn a lot! =)
added on the 2013-03-13 21:44:49 by mog mog
exactly.


oh and of course, watch both of Preacher's seminar's from Assembly

http://archive.assembly.org/2009/seminars/demo-programming-for-beginners

http://archive.assembly.org/2011/seminars/the-basics-of-demo-programming

btw: these have really helped me sort out my plans for some simple timeline control which was one area I'd highlighted in a coding comp needed serious attention, and yes back to the previous point, my "reusable code libraries" did get a bit of a refactor after that too.
added on the 2013-03-13 21:58:55 by Canopy Canopy
basically what mog said.

if you havent done a demo yet, i advise you to do so without any engine at all for now.
As democoding is very different to gamecoding, where you need a flexible engine and such.

second step would be to gather useful functions you can re-use. (dont gather any stuff you COULD NEED in the future, as others stated already, thats just nonsense!)
3rd step would be to code a GUI to make demos, including scratchable timeline etc.

for step 3 going c#/SharpDX should be a perfect/clean/fast solution.

for the first 2 steps C is all you need. no1 really needs any OO for democoding. in my eyes thats overengineering, unless you are coding a demoTool as in step 3.

step1:
- learn oGL or directX
- code some "hello world" in oGL | dX
- remove hello world
- add .obj-loader (google helps, i´d go for some simple .x-loader, as this format compresses in videoMemory on your GPU)
- add some timing (as simple as "if (time<1.0f) part1(); else if (time > 1.0f && time < 2.0f) part2(); and so on)
- add music (BASS or FMod), learn a bit about it, add music-sync-functions while at it
- add content
- release
- get some (hopefully) constructive criticism, learn by reading that, restart.

step 2 is just learning from step1 and reusing the stuff you need to do a demo, forming them into always reusable functions.
Hello all.
Thanks for all the replies. Here is my answer.

Some of you had the idea that I had the intention of making something huge from the start. That was not the intention.
I do use the KISS principle :)

the reason I wanted to hear if you knew of any games made using SharpDX or Demoes, whas that it would give an insigt into the design choices.
From that I will make my own design and implement what I need when I need it.

The development time using C# and SharpDX is faster than C or C++ for me. That is the reason I am chosing SharpDX in the first place.

The Nuaj download link is dead :( but yes that was what I had in mind.

So my goal is the start with a simple frame that can handle extensions.

I have a ray tracer in C++ and a fluid solver in C++, both not really using much oop. Using this new framework in C# I want to use SharpDX and C# to reimplement the ray tracer and the solver using the features of C#.

So I have a lot of things I want to do from there but it would be nice with some base framework to start our with.

I hope I have explained things more clearly now and thanks for all the replies.
added on the 2013-03-13 23:28:27 by MRLB MRLB
Well, don't overthink it - boiled down you only need something that drives your animation by something like time or beats. Though OOP is nice and clean, it might also hinder you to get things done.

You want something to make your coding easier, so don't abstract stuff too far - as you might still want to fiddle in the guts of an effect.

I couldn't agree more with hardy, use iteration - code, see where stuff sucks and hinders you - fix this parts for the next demo. Because what good is a lean and clean engine/fw good for if you don't release stuff :)

Though MVC never did any harm ^^
added on the 2013-03-13 23:40:17 by mog mog
@MRLB: the Nuaj wiki seems dead indeed, try contacting patapom directly http://www.patapom.com/
added on the 2013-03-14 00:16:24 by ponce ponce
the only thing we´re trying to teach you (while we wont teach you anymore in the future, unless you come up with some hard quest of code to solve via IRC), IS that you have to keep it easy and managable all the time! for yourself to keep your oversight.
speaking of myself, i managed my whole "engine/framework" into 4 subClasses and thats it! ;) everythings working like a charm, no available bottlenecks left!
SharpDX is coming with its own framework which is called the "Toolkit", an XNA like API but build on top of Direct3D11 and portable to Windows Desktop, Windows RT and Windows Phone.

Youi can get it from the latest dev package version 2.5 (latest version has also model loading support)
added on the 2013-03-14 00:30:57 by xoofx xoofx
You might be interested also in this short talk I made at Tokyo Demo Fest 2013: "Programming demos with Direct3D11 and C#"
added on the 2013-03-14 00:37:36 by xoofx xoofx
I started a project in XNA, but quickly hit the shader limits (vanilla XNA only supports up to DX9c - don't know about the monogame port). I've since converted to OpenGL via OpenTK.

OpenTK is very much bare-metal OpenGL, which is great because it doesn't lock you into anything. I'm finding that I'm building some lightweight wrappers/extensions to make things easier when it comes to VBOs etc.
added on the 2013-03-14 00:40:31 by bloodnok bloodnok
Quote:
SharpDX is coming with its own framework which is called the "Toolkit"

maybe just avoid this if you want to become a good coder! Some PreSet is not what you want if you want to get a good coder! amiwrong?
You're not wrong hardy,- though it's helpful if you're trying to ride a bike - one day you'll drive without the extra wheels, just do stuff for now, learn and apply what you've learned to your code.
If it sucks, fix it - if it's too slow fix that, though there really is no golden path - some parts of the code will always suck (and might suck a bit less after you learned more) - and there are parts you're rightfully pat on your own shoulder :)

Just demo, learn, fix your engine - go back to step one, that's how most (all?) of us did it <3
added on the 2013-03-14 00:47:00 by mog mog
@mog just looking at the sample of sharpdx for making a cube is big in itself, then when you would add something extra, handling input making a frustum camera and loading a bunch of shaders, the what?
Then OOP and refactoring would be nice, but how would you do that with SharpDx, that is what I am working to find out :)

@ponce I have sent patapom an email on the matter :)

@right so you found a way to split things up. How? and you used C++ ? then that is not the same as SharpDX or C#. And as I asked mog, how then do I handle Scaling?
Off course I would start with something simple, but then I would be stuck again when it comes to something bigger, since I still wont know howto handle scaling.

@xoofx, thank you, i looked into the samples, which are all in one file.

I have been searching a bit more and I found these, which might be usefull. They are examples to what I am looking for.

http://directx4wpf.codeplex.com/
http://www.codeproject.com/Articles/200908/Introducing-DirectX-to-WPF
https://github.com/NekuSoul/SharpDX-Engine
added on the 2013-03-14 00:51:01 by MRLB MRLB
the part about having some "toolSet", hidden between em lines, its managable! making your fw/engine faster everytime you find some clue and include the bettering!
obviously we´ve been there, done that!
but its absoluetly no way of hindering you to join right now, we offer everything we know, while you will be going to offering us everything you learn aswell!
my cent² so far: still overengineerin!

login

Go to top