I have a simple application in which I need to let the user select a shader (.fx HLSL or assembly file, possibly with multiple passes, but all and only pixel shader) and preview it.
The application runs, the list of shaders comes up, and a button launches the "preview window."
From this preview window (which has a DirectX viewport in it...
I am trying to find a cross linux distribution solution to the problem of making a program have transparent windows.
I now there is some methods out there, that take screen shots of the windows underneath and then print them as the background of the image. I would prefer not to uses that method because it likely that i would have video...
In light of the accepted answer pointing out that returning a non-const reference to a member from a const instance method won't compile (without a cast or making the member variable mutable), the question has become more a general best-practices discussion of const instance methods.
For posterity, here's the original question:
If I ha...
Let's say I'm programming in Java or Python or C++ for a simple problem, could be to build an TCP/UDP echo server or computation of factorial. Do I've to bother about the architecture details, i.e., if it is 32 or 64-bit?
IMHO, unless I'm programming something to do with fairly low-level stuff then I don't have to bother if its 32 or 64...
Is if almost always required to have thread syncing (i.e. use of mutex, semaphores, critical sections, etc.) when there is cross-thread data accessing, even if it's not required after going through a requirements analysis?
...
What are some recommended frameworks for manipulating spatial data in C++?
I'm looking for a polygon object, point object, and some operations like union, intersection, distance, and area. I need to enter coordinates in WGS84 (lon,lat) and get area in square km.
I would prefer a free/open source framework, but am open to suggestion...
I have a program in C++, using the standard socket API, running on Ubuntu 7.04, that holds open a socket to a server. My system lives behind a router. I want to figure out how long it could take to get a socket error once my program starts sending AFTER the router is cut off from the net.
That is, my program may go idle (waiting for the...
For the longest time I thought there was no reason to use the static keyword in C, because variables declared outside of block-scope were implicitly global. Then I discovered that declaring a variable as static within block-scope would give it permanent duration, and declaring it outside of block-scope (in program-scope) would give it fi...
I have a pure C++ application developed using VC 6.0. I would like this application to make use of a library developed in C#. How do I call the methods in the C# library from my native executable? I do not want to convert my un-managed C++ native application to managed code. Similarly, how do I do the reverse? Is PInvoke the only option?...
I use astyle to format my code most of the time, and I love it, but one annoyance is that it can't specify at least a "hint" for max line length. If you have a line of code like:
this->mButtonCancel->setLeftClickProc(boost::bind(&FileListDialog::cancelLeftClick, this));
I would like a source code formatter to be able to wrap it even ...
I am trying to set up an automated build system on Windows using Cygwin. Among other things, it needs to be able to build several Visual C++ solutions. I have a script which sets up the environment variables needed for devenv, and if I type 'devenv' in bash it brings up the Visual Studio IDE. No problems so far.
I am also able to buil...
What is a good random number generator to use for a game in C++?
My considerations are:
Lots of random numbers are needed, so speed is good.
Players will always complain about random numbers, but I'd like to be able to point them to a reference that explains that I really did my job.
Since this is a commercial project which I don't h...
Hello,
I'm trying to write a callback event system in DirectX9. I'm attempting to use method function pointers to trigger events to mouseclicks; but I'm having some problems. My game uses a gamestate manager to manage the rendering. All of my gamestates are derived from a base class AbstractGameState.
I have a sprite object with this ...
hello guys, thank you for looking
i got this example from my book but i cant understand why the line
S<void,int> sv; // uses Template at (2)
but
S<void,char> e2;
//uses (1) when im thinking it would use (2) especialization as well
could anyone explain the behavior?
btw all the comments in code below are from book author
t...
For some reason, the following code never calls Event::Event(Event&& e)
Event a;
Event b;
Event temp;
temp = move(a);
a = move(b);
b = move(temp);
why not?
Using std::swap calls it once.
class Event {
public:
Event(): myTime(0.0), myNode(NULL) {}
Event(fpreal t, Node* n);
Event(Event&& other);
Event(Event const& othe...
We've been waiting forever to see if it's going to become a full-fledged language, and yet there doesn't seem to be a release of the formal definition. Just committees and discussions and revising.
Does anyone know of a planned deadline for C++0x, or are we going to have to start calling it C++1x?
...
I compiled the following cords with g++
#include <iostream>
#include <string>
using namespace std;
template<class T>
class Node<const char*>{
private:
string x_;
Node* next_;
public:
Node (const char* k, Node* next):next_(next),x_(k){}
string data(){return x_;}
Node *get_next(){return next_;}
};
$ g++ -c node01.cc
node01.cc:5...
Is there a ready-to-use API (C / C++) in Windows Mobile ecosystem that I could use to generate a GUID? I am looking for simple one-shot API to do this. If there is a need to write a whole algorithm or use some extra 3rd-party modules, I will do away without this.
Background. To display notification to the user I use SHNotificationAdd, w...
Does every file need to #include "stdafx.h" when using precompiled headers? Or do only source files need to include it.
EDIT: Also, my precompiled header file #includes a lot of STL headers. But, in my headers, I sometimes have functions that return std::vector or something like that, so I need to #include <vector> anyway. Is this worse...
Hi all,
I am currently trying to read in video frames by using FFMPEG. The format is PIX_FMT_RGB24; For each frame, the RGB values are all combined together in frame->data[0] (Where frame is of the type AVFrame).
How do I extract the individual R, G and B values for each frame? This is for processing the video. I would think it would ...