I can compile a OpenGL application just fine doing so:

g++ -std=c++11 -o main Main.cpp FastNoise.cpp shader.cpp texture.cpp libglfw3.a lib

GLEW.a -Wl,-Bdynamic -lGL -lGLU -lX11 -lXxf86vm -lXrandr -lpthread -lXi -ldl -lXinerama -lXcursor

But if I compile it like this:

g++.exe -std=c++11 -o main Main.cpp FastNoise.cpp shader.cpp texture.cpp libglfw3.a lib

GLEW.a

Then I get tons of undefined reference errors. I have tried doing this under Ubuntu with MinGw64 and under Windows with MinGw and g++. I had the same issue under Visual Studio and I fixed it by adding this praeprocessor defintions:

WIN32

_WINDOWS

TW_STATIC

TW_NO_LIB_PRAGMA

TW_NO_DIRECT3D

GLEW_STATIC

_CRT_SECURE_NO_WARNINGS

CMAKE_INTDIR="Debug"

Is there any way to tell MinGw to use those praeprocessor defintions? ]]>

From what I can gather, "Full-Screen Exclusive Mode" is no more in D3D12 and Win10. It's been replaced with:

- Windowed Flip (iFlip Immediate)
- aka Independent Flip with True Immediate Present
- aka Independent Flip Swap Chains with True Immediate Presentation (via Waitable Object Swap Chains)

I've got several questions:

- Is this your understanding?
- Can OpenGL apps make use of iFlip Immediate mode? How? (MS's info says D3D12 only)
- If not, what's the best alternative to synchronize with GPU scan-out, bypass as much DWM overhead as possible, and minimize display latency?

If you can answer any of these, or even provide some related info about them (even speculative), I'd appreciate it!

(If you're scratching your head at this post or are interested in more background, here's a pretty good video: DirectX 12: Presentation Modes In Windows 10.) ]]>

Code cpp:

void collisionDetectHandle(pba::Vector& x,pba::Vector& v,double t)
{
cout<<"COLLISIONDETECTION BEGINS HERE";
double f0,f1,intersectionTime,cr,cs,a,b;
pba::Vector velPerp,newpos,intersectionPos,e1,e2,e3,e4;
double temp_time = t;
double maxt=0;
while(NOCOLL == false)//loop until no collision
{
for( size_t i=0;i<faces.size();i++ )
{
std::vector<int>& face = faces[i];
pba::Vector p0 = Vertex(face[0]);
pba::Vector p1 = Vertex(face[1]);
pba::Vector p2 = Vertex(face[2]);
pba::Vector xP=p0;
f0=0;
f1=0;
e1=p1-p0;// e1.xyz[3]
e2=p2-p0;//e2.xyz[3]
e3= e2^e1;//cross product
e4= e1^e2;//cross product
nP= e3/(e3.magnitude());
f0=(x-xP)*nP;//dot product/inner product
f1=(x-v*temp_time-xP)*nP;
std::cout<<"f0 :"<<f0<<"\t"<<"f1:"<<f1<<"\n";
if(f0==0)continue;
else if ((f0*f1)>0)continue;
else
{
intersectionTime = ((x-xP)*nP)/(v*nP);
if (temp_time * intersectionTime <0)continue;
else if(temp_time < intersectionTime)continue;
else
{
intersectionPos = x-v*intersectionTime;
a=(e3*(e2^(intersectionPos - p0)))/(e3.magnitude()*e3.magnitude());
b=(e4*(e1^(intersectionPos - p0)))/(e4.magnitude()*e4.magnitude());
if (b<0||b>1) {cout<<"No collision occured since b<0 | b>1";return;}//no collision
if((a+b<0)||(a+b>1)) {cout<<"no collision occured since a+b <0| a+b > 1";return;}//no collision
else{
if (std::fabs(maxt)<std::fabs(intersectionTime))
{
maxt=intersectionTime;
}
cr=0.2;
cs=0.5;
velPerp = v-nP*(nP*v);//calculate V perp
reflectedVel = cs*velPerp- cr*nP*(nP*v);
newpos = intersectionPos + reflectedVel*maxt;
v= reflectedVel;
x=newpos;
}
}
}//else
}//for loop ends
//calculate maximum intersection time
temp_time= maxt;
NOCOLL = true;
}//while loop ends
}