Massively struggling with laying out DirectX and windows [closed] - c++

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I have managed to get this example to work:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd370994(v=vs.85).aspx
My problem is that I am trying to structure the code there into something more understandable...
My first step is to remove all the stuff that's not absolutely necessary to lanching a window with a direct x surface... but as soon as I start messing with the code, I get massively confused at which components are core, and which are not...
Do you know of a kind of boilerplate project with literally the utmost basics in it for a directx surface in a window.
D2D is fine unless you suggest I just code straight in D3D... even though i'm only going to be drawing 2d stuff.
I've read so many resources and tutorials for directX but every blooming one has different bits and bobs placed in and it's so difficult to just learn what the "must" bits are!...
Just to help you with the question.
I have started by trying to create a Gfx object that will start and create surfaces and resources for direct X, I also tried to separate my windows code but ofcourse got a bit lost there too... Finally I wrapped up my Game class so that the windows loop just ran begin draw, render and end draw. in the tutorial above you have 2 brushes which as i'm not familiar with directX, I'm unsure if I can just whip them out completely or what?
I guess a step in the right direction is really what i'm looking for.

I very strongly suggest that you get hold of a decent book that can guide you through the steps:
For example - try to get a copy of this

Related

Drawing lines with boost::gil? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need to draw some lines on an (off-screen) image. I'd like to use boost::gil because the lib is already integrated in my project.
I want to draw a line from start to end point in a 2dim array
Can anybody give me a quick example how to draw a line using gil?
Thank you.
GIL itself is very much concerned with storage of images and pixels in various formats and converting between them... but no more than that. user1929959's answer is using a GIL extension which facilitates interoperability of GIL with OpenCV and then uses OpenCV's line drawing (but OpenCV doesn't come with boost so you'd need to add that into your project too).
For high quality antialiased line drawing AGG and Cairo might also be worth considering (although you'd need to figure out how best adapt GIL images to their own image buffer types). But if you just want basic one pixel wide lines, consult any basic computer graphics text for some Bresenham's line algorithm pseudocode which could be trivially implemented using pixel-setting.
First take a look on boost::gil tutorial. You can find an example in drawing test, from where can easily extract method to drawing line.

Graph editor on Qt [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I'm writing a graph editor now. The programs must be written on Qt, but the problem is that I don't have enough experience with Qt, but I'm little experienced with C++. Last weeks I read one book about Qt, but I've read about 100 pages, so I know only some basics.
Can somebody give me advices about what classes should I use, please?
What I've already done:
I filled menubar with menus File, Algorithms, About etc.
I suppose that graph vertexes etc I should draw on QGraphicsView, so I added it too, also I add QGraphicsScene and bind them together (ui->setScene(scene)).
Sorry for my mistakes, unfortunately I don't have a complete understanding about all these things.
Also I added QGraphicsRectItem with scene->addRect() and set the flag moveable. But I don't know what classes should I have to use.
So, in general I want to understand how to do next things:
I want to add a panel with 2 buttons (vertex, line). After I chose vertex button (or what it will be) and click on the QGraphicsView - vertex should appear at that point. Also I must be able to change vertex name
After I chose line mode (link, which connected 2 vertexes) I should be able to connect 2 vertexes together depending on graph type (oriented or not).
By clicking on link between vertexes I should be able to change the weight of link.
I think it would be enough for one question.
Sorry if the question is very simple or stupid.
Thanks.
Your question is rather broad so it's nearly impossible to answer it entirely. So instead, I'll offer a really good example you might go look at. This example does much of what you want and might be a good starting set of code to both look at as well as reuse.

OS development. How to start? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I am java developer. I always wanted to write my own kernel and develop an small os, I don't know what this kernel or os will look like or what they will do but I have a passion develop something useful to contribute to this vast and beautiful open source world. I want to do this but my problem is that I don't know how to start. I had studied c/c++ in my college days, now I don't remember much of these programming languages but I can brush that up to get started. I know this journey would be difficult and long but each long journey starts with a single step.
To make sure I take correct step in right direction I need help of experts on this forum to guide me to correct direction. I am not expecting spoon feeding but your thoughts on this and references to the good books and links that could help a newbie like me to get started with such programming.
Thanks
To be honest:
I don't know what this kernel or os will look like or what they will do but I have a passion develop something useful to contribute to this vast and beautiful open source world.
If your aim is to contribute to the Open Source software pool, do not attempt to write an operating system, but pick a different thing to do. There are literally hundreds of OS projects, some of them several years in the making, and the general consensus of the OS development community over at OSDev.org is that it is interesting and fun, but not necessarily productive.
If you insist, follow that link I gave; you will find information and further links there.
Edit: If you are looking for an interesting project to learn a new language with, pick something that you would want to use. There's a reason why so many people have programmed a calculator or an address management in their early days. But seriously, C++ in kernel space is so very much different from C++ in application development that they could just as well be different languages.

How to render ocean wave using opengl in 3D? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How to render ocean waves using opengl in 3D? Any reply will be welcome.
Edit:
Is there any source code that renders ocean waves but not using an other sdk or api? It's difficult to learn how render it by read OSG source code maybe. So any tutorials about it will be ok, it is very good that it attach the source code.
Christian (above) is right. Currently your question is very broad and difficult to answer. You might want to do some research yourself and then ask a more targeted question.
Start looking at shallow water equations for example. (I'm skipping full fluid simulations here for the moment) Or read Tessendorf's "Simulating Ocean Waves". Or have a look at Cem Yuksel's wave particles. Even if you don't end up implementing any of it, the references will be a good resource for you. Another one might be this collection of links.
Not really a clear answer, but give us more to go on and we can point you in a more specific direction.
Rendering realistic looking water is extremely difficult. Luckily there are tools to make it easier, like OSGOcean, which can render some quite impressive waves.

how to use video memory as standard memory storage? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I would use video memory on video board (256mb) as a standard memory for storing random values. I know very little about video graphics but i know that one approach is to just make 'models' or other video graphics objects storing my values, thus the video board thinks it processes video images or something this way. But is there another approach?
good article is http://en.gentoo-wiki.com/wiki/Using_Graphics_Card_Memory_as_Swap
that how linux has implemented it. Looks like i need to write windows device driver for graphics subsystem to access video memory.
MS resource about video memory: http://blogs.msdn.com/b/tmulcahy/archive/2009/02/11/windows-and-video-memory.aspx
This is a worse idea than you can possibly comprehend, but sure, you can always allocate a texture with DirectX and set it to be put in video memory only, write stuff in it, then at some later time lock it and read your data back out.
Good luck achieving a fifth of the speed you would by using normal system memory however.