I'm trying to find like NeHe's tutorials for Qt that are all in GLSL. Because lets face it, OpenGL in the old days are dead and Shaders are the only way now. And with Qt-4.6 they introduced the QMatrix4x4, QVector3, and the Shader classes. But I cannot find any tutorials for this.
All the ones I do find, all use crappy SDL and/or GLUT (...
Fraction AddFractions(const Fraction& frac1, const Fraction& frac2)
{
Fraction frac3;
if (frac1.denom == frac2.denom)
{
frac3.num = frac1.num + frac2.num;
frac3.denom = frac1.denom;
}
else
{
frac3.denom = (frac1.denom * frac2.denom);
frac3.num = (frac1.num * frac2.denom) ...
I have a gigantic project that is built using makefiles. Running make at the root of the project takes over 20 minutes when no files have changed (i.e. just traversing the project and checking for updated files).
I'd like to create a dependency map that will tell me which directories I need to run 'make' in based on the file(s) changed....
I remember encountering this concept before, but can't find it in Google now.
If I have an object of type A, which directly embeds an object of type B:
class A {
B b;
};
How can I have a smart pointer to B, e. g. boost::shared_ptr<B>, but use reference count of A? Assume an instance of A itself is heap-allocated I can safely get ...
Suppose I write a C++ semaphore class with an interface that models the boost Lockable concept (i.e. lock(); unlock(); try_lock(); etc.). Is it safe/recommended to use boost locks for RAII access to such an object? In other words, do boost locks (and/or other related parts of the boost thread library) assume that the Lockable concept w...
I have a problem due to my terrible math abilities, that I cannot figure out how to scale a graph based on the maximum and minimum values so that the whole graph will fit onto the graph-area (400x420) without parts of it being off the screen (based on a given equation by user).
Let's say I have this code, and it automatically draws squa...
I was told I have to use winsock, but I dont know where to start. For example, I am trying to access, lets say http://www.newegg.com/, I am trying to get the text title of just the three front page products. Any help is greatly appreciated. :D
...
I am programming in a Win32 nt5 environment.
I have a function that is going to be called many times. Each call is atomic. I would like to use QueueUserWorkItem to take advantage of multicore processors.
The problem I am having is I only want to give the function 3 seconds to complete. If it has not completed in 3 seconds I want to te...
i came across this line is stroustrup An operator function must either be a member or take at least one argument of a user-defined type (functions redefining the new and delete operators need not).
Dont operator new and operator delete take an user defined type as one of their arguments?
what does it mean, am i missing something here
...
I'm displaying a bitmap using GDI+. After loading the bitmap from a DLL resource I set the background colour (blue - #0000FF) to transparent using TransparentBlt. On Windows Vista and later this works as expected.
However, on a Windows XP system we're testing on this only works when any tooltip (e.g. the "title" property in IE, or Win...
Quick background
I'm a Java developer who's been playing around with C++ in my free/bored time.
Preface
In C++, you often see pop taking an argument by reference:
void pop(Item& removed);
I understand that it is nice to "fill in" the parameter with what you removed. That totally makes sense to me. This way, the person who asked to ...
Greeting,
This month I will start working on my master thesis. My thesis's subject is about network security.
I need to deal with network interfaces and packets.
I've used shappcap before to interact with packets but I'm not sure if C# is the most powerful language to deal with network programing and packets.
I worked a bit with wire...
When I set glStencilFunc( GL_NEVER, . . . ) effectively disabling all drawing, and then run my [shader-bound] program I get no performance increase over letting the fragment shader run. I thought the stencil test happened before the fragment program. Is that not the case, or at least not guaranteed? Replacing the fragment shader with one...
Hello,
I am trying to redirect the output from my DLL to an external console window for easy debugging.
I have been told about AllocConsole but I am not able to reproduce it, i.e. the console window does not appear.
My current environment is Visual Studio 2005.
I tried the following example which is gotten off the Internet,
AllocCon...
Hi everyone
I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and write I class like this.
class CompositeIte...
Hi,
Need help...
I have 3 classes, Manager which holds 2 pointers. One to class A another to class B . A does not know about B and vise versa.
A does some calculations and at the end it puts 3 floats into the clipboard.
Next, B pulls from clipboard the 3 floats, and does it's own calculations.
This loop is managed by the Manager and r...
So I have a visual studio 2008 project setup for a project I've been working on however its a sub project of a rather larger code base which is crossplatform, so in order to make my project complaint with the main source I need to make my project nix compilable.
Is there some way I can generate a makefile based off my vcproject? or if ...
Does anyone know of a C++ data structure library providing functional (a.k.a. immutable, or "persistent" in the FP sense) equivalents of the familiar STL structures?
By "functional" I mean that the objects themselves are immutable, while modifications to those objects return new objects sharing the same internals as the parent object wh...
I would have dared say that the numeric values computed by Fortran and C++ would be way more similar. However, from what I am experiencing, it turns out that the calculated numbers start to diverge after too few decimal digits. I have come across this problem during the process of porting some legacy code from the former language to the ...
I wish to use QtWebKit to load a url for display, but, that's the easy part, I can do that. What I wish to do is record / log xml as I go. My attention here is to record and database certain details on the fly, by recording those details.
My problem is, how to do this all on the fly, without requesting the same url from the server twice...