Jump to content

  • Log In with Google      Sign In   
  • Create Account

Spirrwell

Member Since 11 Nov 2011
Offline Last Active Dec 04 2014 10:47 AM

Topics I've Started

Deciding on a Game Engine?

11 October 2014 - 01:19 AM

Alright, I know this is probably going to come across as horrible for asking something that's been asked before 100s of times and recently a thread was created about engines to use for indie developers. I'm just really REALLY having a tough time figuring out what to go for.

 

To start off, I've worked with the Unity engine, UDK, and Source. I've looked around at other engines, what they're capable of, what I'm looking for in them specifically, and if I can even actually use it.

 

So far the biggest challenge I've come across isn't so much a technical issue, but a licensing one. Unity is free for both commercial and non-commercial use, but comes at the cost of being limited with what you can actually do with it. Since the pro version is essentially out of the question for me, I'm limited to using its free version. It is a wonderful engine in that while limited it's incredibly flexible, and cross platform. Though it still lacks dynamic lighting, video playback, and a load of other features.

 

With Unreal 4 having been released, I was very excited that it would be out, support Linux\more platforms, and be all around better, but it requires a subscription... UDK is an absolute powerhouse, and has an excellent editor and interface. However, UDK is only UE3, doesn't have Linux support, and thus dwindles my interest.

 

Source... it's cross platform, it works, but license fees... Bugs... built on an ancient engine... Enough said... Sadly it's likely the engine I have the most experiences with, and I like it for having programs with their own set of functions, and not that whole all in one type deal.

 

I kind of would like to go a homebrew engine route as then I'd be limited purely by the libraries I use, and I'd learn a lot along the way, like how I'd much rather have a big budget engine. XD

 

I had a look at CryEngine 3, but, well, licensing! I was kind of interested in testing out the Blender game engine as I'm familiar with it as a model editor, however, I'd need to learn Python and it doesn't seem like a well fledged engine, nor do I know its potential licensing debacle. Really it seems like my own best bet is Unity, but is that really it? I've looked at other engines, but it seems like everywhere I look there's always a wall somewhere whether it be license or limitation.

 

I apologize for the multi-paragraph essay, but I'm just banging my head against the wall. All I want is a simple flexible engine that's cross platform, that isn't binding or limiting. That's probably asking way too much, but I figured I'd give it a shot!


(C++)Cross Platform Audio API?

02 November 2013 - 02:00 PM

I know this is a done to death question, but I'm still in huge debate. I've used OpenAL, SDL_Mixer, and Audiere. I like SDL_Mixer and Audiere for their simplicity, but I like OpenAL for its lower level implementation, as in I kind of have more freedom to do what I want with it, but it's farther from simple to use.

 

I'm looking for something that's cross platform, simple, but not so simple that it's just mainly, play, pause, and stop and difficult to implement something more for whatever I need.

 

I mean for a certain project I would only need maybe OGG and WAV support, but for others I may need more support. So I'm really looking for a flexible API that's preferably royalty free.

 

Anybody have any suggestions?


Export Textures As an Animated GIF?

24 June 2013 - 04:40 PM

Well, I haven't really been able to find a way to use FFMPEG and synchronize audio and video, so I figured I'd focus on something that I probably could do with it. I can take a video and decode its video frames into a GLuint texture. What would be a good library that I could use to export the frames I decode into an animated GIF?

 

Any help is greatly appreciated.


SDL 2.0\FFMPEG Swap Window Issue.

26 January 2013 - 07:32 AM

I decided to go back and try to rewrite my old FFMPEG code from C to C++ and SDL 1.2 to SDL 2.0. There was one issue I overlooked and that's whenever I read a frame from a video, I need to call SDL_GL_SwapWindow() as soon as the frame has finished or else I'll have an issue where in between each frame or so, the screen goes black. (or it just lags if I don't call glClear()) I also have to draw the frame immediately after it's read or else the same thing will happen except the screen will clear white instead of black.

 

The problem is, each video would have their own rendering code inside my Video class, or maybe I would want to render something else that's not a video, well, I would need to call SDL_GL_SwapWindow(), which I can't do or else it will interfere with my video.

 

Here is my current rendering code:

 

void Video::Render(SDL_Window* win)
{
    if (av_read_frame(pFormatCtx, &packet) >= 0)
    {
        if (packet.stream_index == videoStream)
        {
            avcodec_decode_video2(pCodecCtx, pFrame, &FrameFinished, &packet);
            if (FrameFinished)
            {
                sws_scale(swsContext, pFrame->data, pFrame->linesize, 0, pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
                glGenTextures(1, &VideoTexture);
                glBindTexture(GL_TEXTURE_2D, VideoTexture);
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
                glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
                glTexImage2D(GL_TEXTURE_2D, 0, 3, pCodecCtx->width, pCodecCtx->height, 0, GL_RGB, GL_UNSIGNED_BYTE, pFrameRGB->data[0]);

                glEnable(GL_TEXTURE_2D);
                glPushMatrix();
                glBindTexture(GL_TEXTURE_2D, VideoTexture);
                glBegin(GL_QUADS);
                glTexCoord2i(0, 0); glVertex2i(0, 0);
                glTexCoord2i(1, 0); glVertex2i(800, 0);
                glTexCoord2i(1, 1); glVertex2i(800, 600);
                glTexCoord2i(0, 1); glVertex2i(0, 600);
                glEnd();
                glPopMatrix();
                glDisable(GL_TEXTURE_2D);
                SDL_GL_SwapWindow(win);
                glDeleteTextures(1, &VideoTexture);
                av_free_packet(&packet);
            }
        }
    }
    else
    {
        av_seek_frame(pFormatCtx, videoStream, 0, AVSEEK_FLAG_BACKWARD);
        SDL_GL_SwapWindow(win);
    }
}

 

And here's my while loop in main() that does the rendering and whatnot:

 

while (!Done)
    {
        while (SDL_PollEvent(&event))
        {
            HandleEvent(event, Done);
        }
        glClear(GL_COLOR_BUFFER_BIT);
        TestVideo.Render(Win);
        //This is where I want to call SDL_GL_SwapWindow()
    }

 

So, what's the problem? Why do I need to draw each frame and call SDL_GL_SwapWindow() immediately after a frame is read? Ideally I should have two to three separate functions, one for reading each frame, one for rendering the read frame, and one for freeing up memory used by each frame. Any help is appreciated.


SDL Odd Linker Errors

24 January 2013 - 02:19 PM

I'm having a problem with SDL (currently using SDL 2.0 but the same problem occurs when using SDL 1.2) when linking to it in Windows. I'm currently using Code::Blocks 12.11 and the code surely isn't the problem, I could write the same code before on different operating systems\computers without a problem it's just that SDL will not link properly and I'm thinking it may have to do with the way I built it with MSYS, so if that's the problem let me know.

 

Here's what I get:

 

||=== SDL2, Debug ===|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_systimer.o)||In function `SDL_StartTicks':|
c:\SDL-2.0.0-6799\src\timer\windows\SDL_systimer.c|59|undefined reference to `timeBeginPeriod@4'|
c:\SDL-2.0.0-6799\src\timer\windows\SDL_systimer.c|60|undefined reference to `timeGetTime@0'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_systimer.o)||In function `SDL_GetTicks':|
c:\SDL-2.0.0-6799\src\timer\windows\SDL_systimer.c|85|undefined reference to `timeGetTime@0'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowswindow.o)||In function `WIN_SetWindowGammaRamp':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|511|undefined reference to `CreateDCW@16'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|513|undefined reference to `SetDeviceGammaRamp@8'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|517|undefined reference to `DeleteDC@4'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|517|undefined reference to `DeleteDC@4'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowswindow.o)||In function `WIN_GetWindowGammaRamp':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|530|undefined reference to `CreateDCW@16'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|532|undefined reference to `GetDeviceGammaRamp@8'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|536|undefined reference to `DeleteDC@4'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowswindow.c|536|undefined reference to `DeleteDC@4'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_winmm.o)||In function `WINMM_CloseDevice':|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|166|undefined reference to `waveInClose@4'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|171|undefined reference to `waveOutClose@4'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|178|undefined reference to `waveOutUnprepareHeader@12'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|178|undefined reference to `waveOutUnprepareHeader@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_winmm.o)||In function `WINMM_PlayDevice':|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|129|undefined reference to `waveOutWrite@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_winmm.o)||In function `DetectWaveOutDevs':|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|51|undefined reference to `waveOutGetNumDevs@0'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|51|undefined reference to `waveOutGetDevCapsW@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_winmm.o)||In function `DetectWaveInDevs':|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|52|undefined reference to `waveInGetNumDevs@0'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|52|undefined reference to `waveInGetDevCapsW@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_winmm.o)||In function `WINMM_OpenDevice':|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|209|undefined reference to `waveInGetNumDevs@0'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|212|undefined reference to `waveInGetDevCapsW@12'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|222|undefined reference to `waveOutGetNumDevs@0'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|225|undefined reference to `waveOutGetDevCapsW@12'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|301|undefined reference to `waveInOpen@24'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|355|undefined reference to `waveOutPrepareHeader@12'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|355|undefined reference to `waveOutPrepareHeader@12'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|305|undefined reference to `waveOutOpen@24'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_winmm.o)||In function `SetMMerror':|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|104|undefined reference to `waveOutGetErrorTextW@12'|
c:\SDL-2.0.0-6799\src\audio\winmm\SDL_winmm.c|104|undefined reference to `waveOutGetErrorTextW@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_mmjoystick.o)||In function `SDL_SYS_JoystickInit':|
c:\SDL-2.0.0-6799\src\joystick\windows\SDL_mmjoystick.c|162|undefined reference to `joyGetNumDevs@0'|
c:\SDL-2.0.0-6799\src\joystick\windows\SDL_mmjoystick.c|167|undefined reference to `joyGetPosEx@8'|
c:\SDL-2.0.0-6799\src\joystick\windows\SDL_mmjoystick.c|169|undefined reference to `joyGetDevCapsW@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_mmjoystick.o)||In function `SDL_SYS_JoystickUpdate':|
c:\SDL-2.0.0-6799\src\joystick\windows\SDL_mmjoystick.c|328|undefined reference to `joyGetPosEx@8'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windows.o)||In function `WIN_CoInitialize':|
c:\SDL-2.0.0-6799\src\core\windows\SDL_windows.c|47|undefined reference to `CoInitialize@4'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windows.o)||In function `WIN_CoUninitialize':|
c:\SDL-2.0.0-6799\src\core\windows\SDL_windows.c|61|undefined reference to `CoUninitialize@0'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowsopengl.o)||In function `WIN_GL_ChoosePixelFormatARB':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsopengl.c|399|undefined reference to `ChoosePixelFormat@8'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsopengl.c|399|undefined reference to `SetPixelFormat@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowsopengl.o)||In function `WIN_GL_SetupWindow':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsopengl.c|518|undefined reference to `SetPixelFormat@12'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowsopengl.o)||In function `WIN_GL_ChoosePixelFormat':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsopengl.c|206|undefined reference to `DescribePixelFormat@16'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsopengl.c|210|undefined reference to `DescribePixelFormat@16'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowsopengl.o)||In function `WIN_GL_SwapWindow':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsopengl.c|668|undefined reference to `SwapBuffers@4'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowsmodes.o)||In function `WIN_GetDisplayMode':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsmodes.c|62|undefined reference to `CreateDCW@16'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsmodes.c|71|undefined reference to `CreateCompatibleBitmap@12'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsmodes.c|72|undefined reference to `GetDIBits@28'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsmodes.c|73|undefined reference to `GetDIBits@28'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsmodes.c|74|undefined reference to `DeleteObject@4'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsmodes.c|75|undefined reference to `DeleteDC@4'|
..\..\..\..\..\..\Program Files (x86)\CodeBlocks\MinGW\lib\libSDL2.a(SDL_windowsframebuffer.o)||In function `WIN_CreateWindowFramebuffer':|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsframebuffer.c|36|undefined reference to `DeleteDC@4'|
c:\SDL-2.0.0-6799\src\video\windows\SDL_windowsframebuffer.c|39|undefined reference to `DeleteObject@4'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings (0 minutes, 4 seconds) ===|

 

 

I've asked on the SDL forums, I got nothing, and when I look it up all I see is people saying to link winmm which I shouldn't have to do, and it doesn't work anyway. I can't figure it out. Any help?


PARTNERS