the best books? + mp3 streaming while displaying gfx
Being new to games/graphic programming I was wondering what books do you people recommend?
I''ve been making a little demo and while the playsound function of winmm.lib works fine, I can see the wav files it supports being rather "bulky" to say the least. So I had alook at the DirectX SDK and dshow.h supports mp3 so I put together the code:
IGraphBuilder *pGraph;
IMediaControl *pMediaControl;
IMediaEvent *pEvent;
CoInitialize(NULL);
// Create the filter graph manager and query for interfaces.
CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGraph);
pGraph->QueryInterface(IID_IMediaControl, (void **)&pMediaControl);
pGraph->QueryInterface(IID_IMediaEvent, (void **)&pEvent);
// Build the graph. IMPORTANT: Change string to a file on your system.
pGraph->RenderFile(L"C:\\15.mp3", NULL);
// Run the graph.
pMediaControl->Run();
// Wait for completion.
long evCode;
pEvent->WaitForCompletion(INFINITE, &evCode);
// Clean up.
pMediaControl->Release();
pEvent->Release();
pGraph->Release();
CoUninitialize();
which works fine - however it stops the rendering dead. Do I need to create another window instance to play this while the graphics are rendering or thread it with the rendering or what? Or is there a better way to handle this?
"Being new to games/graphic programming I was wondering what books do you people recommend?"
If you''re gonna be learning OpenGL then get OpenGL Game Programming by Kevin Hawkings and Dave Astle. Also get the OpenGL Programming Guide Third Edition by the OpenGL Architecture Review Board. If you''re not sure if you want to learn DirectX or OpenGL then go to http://nehe.gamedev.net/ to read some tutorials on OpenGL to see if you like it.
If you''re gonna be learning OpenGL then get OpenGL Game Programming by Kevin Hawkings and Dave Astle. Also get the OpenGL Programming Guide Third Edition by the OpenGL Architecture Review Board. If you''re not sure if you want to learn DirectX or OpenGL then go to http://nehe.gamedev.net/ to read some tutorials on OpenGL to see if you like it.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement