Where the DirectDraw initialization code is in the SDL2 code? - sdl

Can you point its exact location to me? Should be somewhere in src/video/windows...
Or was it thrown out, and now GDI is used instead for software rendering?

Yes, not avaible anymore. In the first SDL it was in the src/video/windx5

Related

Toggling NvAPI_Stereo_Deactivate/NvAPI_Stereo_activate crashes the unity application

I'm currently working on external plugin in Unity3d which uses NVAPI & 3D Vision. In NVAPI there are two API calls to turn on/off active stereo.
NvAPI_Stereo_Deactivate
NvAPI_Stereo_Activate
So whenever I try to toggle on/off stereo it crashes at random time with following exception:
Unity Player [version: Unity 2017.1.0f3 (472613c02cf7)]
nvwgf2umx.dll caused an Access Violation (0xc0000005) in module nvwgf2umx.dll at 0033:6f9981d8.
The crash can happen at third try or any try later sometimes. What I'm assuming currently is it has to do something with some value accessed by the dll. Problem is since its NVIDIA internal I have no access to it.
I have already tried other simple methods such as Vsync off, Change Quality settings to max in Manage 3d settings but all failing.
I did come across similer issue in NVDIA dev forums but there is not answer to it seems. Any suggestions or help regarding this would be greatly appreciated.
Also here is the link to error log
I have managed to fix this above issue using a roundabout way. Instead of using
NvAPI_Stereo_Deactivate
NvAPI_Stereo_Activate
functions to turn on & off 3d vision I'm passing the render texture to mono eye in NvAPI_Stereo_SetActiveEye to mono camera while in active mode I pass it to Left Eye & Right Eye respectively. Toggling seems to work properly although I have also noted using NvAPI_Stereo_IsActivated in a loop seems to cause also same access violation so rather only user NvAPI_Stereo_SetActiveEye function to set eye and not to mess around with NVAPI native functions. One downside of using this is 3d emitter will be kept on unitil the exit of application(for my project this seems ok). Hope this helps anyone in future coming across this problem. Do update the answer if anyone has a better solution. That would be nice.

Direct3d world to screen

I'm new in direct3d and i got a newbie question.
I got a point in the world and the location of the camera. I would like to know where i will see the point on my screen. I know the width/height of my screen, the field of view of the camera and everything else. I think that there will be function that do that and i don't need to calculate my self.
I searched a lot and couldn't find it, how do i do that?
The only thing i found is: http://msdn.microsoft.com/en-us/library/bb205516%28VS.85%29.aspx but i didn't understand what to give to him (im new in direct3d as i said)
Thank you for your help
First of all, Direct3D is not a solution to world to screen transformation, it is an API that lets you use the GPU to solve that problem faster on the GPU, but if you don't know, how to do it without Direct3D, then Direct3D will probably of no help. So you have to learn the linear Algebra, and the Rendering Pipeline (which is already documented in a lot of places).

BMP texture doesn't show

I've encountered a problem whilst learning how to texture in OpenGL (from OpenGL 5th Edition Bible). The problem is that I can't display my texture. I load it from a BMP file with a function I've written myself.
Since code is quite lengthy I uploaded all neccessery files. You can download it from here.
EDIT: I've tried copying code from the mentioned book (TGA loading described there) and it doesn't work as well. It seems that loading stucks at loading image data from file (strange). I suppose it isn't relevant as far as my problem is concern.
There are general debug steps for checking for problems. I will list them below in the hope you might find the bug (and for future readers):
Does the file exist? Is the file being read properly according to the format? Did you get it to gel well with OpenGL? My suggestion: Do not mess with these things yourself. Use a library. There's an amazingly light weight SOIL (Simple OpenGL Image library)
Are you loading the textures before initialising OpenGL? This was always my problem because I used to "load" and do a glBindTexture(..) in the constructor (of some class). The objects were created before OpenGL was initialised.
Have you enabled GL_TEXTURE_2D? Check the initialise code, use: glEnable(GL_TEXTURE_2D)
Did you map the textures properly with the quad or the shape you want it on? Expanding on this here is (sort of) out of scope. There are great tutorials out there.
(Would seem stupid, but happens sometimes) Are you blacking out the object by glColor3f(0,0,0) ?
There could be more checks, but these are the ones hitting my head now

no-render with OpenGL --> contexts

i have a program that does some GPU computing with Optional OpenGL rendering.
The use dynamic is as follow:
init function (init GLEW being the most relevant).
load mesh from file to GPU (use glGenBuffers are related functions to make VBO).
process this mesh in parallel (GPU Computing API).
save mesh into file.
my problem is that when mesh is loading i use opengl calls and wihout context created i just
get segmentation fault.
Edit: Evolution of the problem:
I was missing GL/glx.h I thought that GL/glxew.h included it, thanks to the answers that got fixed.
I was missing glXMakeCurrent; and therefore it was having zero contexts.
After this fixes, it works :).
also thanks for the tools suggestions, i would gladly use them it is just that i needed the low level code for this particular case.
i tried making a context with this code ( i am using glew, so i change the header to GL/glxew.h but the rest of this code remains the same)
Don'd do it. glxew is used for loading glx functions. You probably don't need it.
If you want to use GLEW, replace GL/gl.h with GL/glew.h leave GL/glx.h as it is.
X11 and GLX are quite complex, consider using sdl of glfw instead.
Just wildly guessing here, but could it be that GLEW redefined glXChooseFBConfig with something custom? Something in the call of glXChooseFBConfig dereferences an invalid pointer. So either glXChooseFBConfig itself is invalid, or fbcount to so small, or visual_attribs not properly terminated.
GLEW has nothing to do with context creation. It is an OpenGL loading library; it loads OpenGL functions. It needs you to have an OpenGL context in order for it to function.
Since you're not really using this context for drawing stuff, I would suggest using an off-the-shelf tool for context creation. GLFW or FreeGLUT would be the most light-weight alternatives. Just use them to create a context, do what you need to do, then destroy the windows they create.

gdi+ GetWorldTransform() where is it in directx?

so im arguing with my friend about GetWorldTransform(). im saying that this DEVICE->GetTransform(D3DTS_WORLD, &matWorld); is the same as GetWorldTransform() in gdi+.
am i right or wrong? if im wrong what is it than in directx?
Yeah you are definitely wrong. The GDI+ world transform is very simple and only allows transformations in 2D. Checkout the XFORM structure to see how different it is to a Direct 3D matrix. Its not even homogeneous. The 2 "may" end up going to the same hardware functionality but there is no guarantee of this. GDI+ is quite a high level wrapper where Direct3D is much closer to the metal. The 2 really aren't comparable.
Well, AFAIK GDI+ is 2D and DirectX is 3D. so they are not equal in that matter, and continuing on that, there wouldn't be a match either.
So according to me:
am i right or wrong?
You are wrong.
if im wrong what is it than in directx?
There is no equivalent.