Announcement

Collapse
No announcement yet.

Hurrican SDL Port

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pickle
    replied
    Interesting that it fixed the graphical issues.

    Also you could try without -DRGBA_5551, this converts all the images to 16 bit textures where without would otherwise been 32 bit.

    I should probably fix the makefile to use GL2 by default. Most likely I was testing the ES portions at the time of checking it in.

    Leave a comment:


  • danboid
    replied
    OGL2 Hurrican - it works and heres how!

    Thanks for the extra compilation info there Pickle! Thanks to that, I have now got Hurrican compiled, running and looking every bit as good as the Windows original under Ubuntu 12.04 (KXStudio) amd64!

    It really didn't look too hot when compiled using the default linux target build options which I think caused it to use the EGL renderer, at least not here using the non-free nvidia driver. Now that its using GL2 it looks very slick indeed! Now I'd like to be even more verbose so others can check out this flagship FLOSS platform shooter more easily.

    To configure Hurrican to use OpenGL 2 rendering instead of EGL when compiling it for 'desktop Linux' (STOP PRESS! This is the year of desktop Linux! ) such as Ubuntu or Debian running on a PC (ie a machine with a GL2-capable GPU and suitable driver), edit

    Code:
    hurrican-code/Hurrican/src/Makefile
    Change the TARGET to linux and then alter the build options as such:

    Code:
    ifeq ($(TARGET),linux)
    
    EXE := ../hurricanlinux
    CCP := gcc
    CC  := gcc
    LD  := g++
    RM  := rm -f
    
    USE_EGL := no
    USE_GL2 := yes
    
    DEFINES += -DLINUX -DUSE_GL2 -DRGBA_5551
    
    INCLUDES_OS := -I/usr/include -I/usr/include/SDL -I/usr/include/GL -I/usr/include/libmodplug
    
    LDFLAGS := -g -lSDL -lGL -lSDL_mixer -lSDL_image -lmodplug -lX11
    
    endif
    Last edited by danboid; 14 August 2013, 11:23 AM.

    Leave a comment:


  • Pickle
    replied
    The target should be linux. I think i need to more info for switching the renderer.
    Basically you need to switch out the existing defined, include path, and LDFLAGS library with the following:

    GL1:
    Defines: -DUSE_GL1
    Include: -I/usr/include/GL
    Library: -lGL

    GL1 ES:
    Defines: -DUSE_GL1 -DUSE_GLES1 -DUSE_EGL_SDL
    Include: -I/usr/include/GLES
    Library: -lEGL -lGLES_CM (this name can vary according to the system)

    GL2:
    Defines: -DUSE_GL2
    Include: -I/usr/include/GL
    Library: -lGL

    GL2 ES:
    Defines: -DUSE_GL2 -DUSE_GLES2 -DUSE_EGL_SDL
    Include: -I/usr/include/GLES2
    Library: -lEGL -lGLESv2

    Edit:
    Turn these on when needed, these will include the required source files for these features. You had USE_EGL set to no and thats why you had missing refs to EGL_* calls.
    USE_EGL := yes
    USE_GL2 := yes
    Last edited by Pickle; 14 August 2013, 10:07 AM.

    Leave a comment:


  • danboid
    replied
    new Linux targets required?

    In my last two Makefile examples, I neglected to mention I was also changing the TARGET directive to 'linux' too, of course.

    As it stands, that is the only change I have been successful in making to the Makefile and having it build. Changing anything else just gives errors for me.

    If a command line switch or in-game config menu option to switch renderer isn't planned then it would be nice to add some more targets to the Makefile ie linux-egl, linux-gl, linux-gl2 etc. maybe instead of just linux. I am of course presuming switching renderer will fix my GFX probs - I could be wasting out time?

    Thanks Pickle!

    Leave a comment:


  • danboid
    replied
    Here's another config I just tried:

    Code:
    ifeq ($(TARGET),linux)
    
    EXE := ../hurricanlinux
    CCP := gcc
    CC  := gcc
    LD  := g++
    RM  := rm -f
    
    USE_EGL := no
    USE_GL2 := yes
    
    DEFINES += -DLINUX -DUSE_GL2 -DUSE_GLES2 -DUSE_EGL_SDL -DRGBA_5551
    
    INCLUDES_OS := -I/usr/include -I/usr/include/SDL -I/usr/include/GLES2 -I/usr/include/libmodplug
    
    LDFLAGS := -g -lSDL -lGLESv2 -lSDL_mixer -lSDL_image -lmodplug -lX11 -lEGL
    GCC sez

    Code:
    DX8Graphics.cpp:263: error: undefined reference to 'EGL_Open'
    DX8Graphics.cpp:297: error: undefined reference to 'EGL_Init'
    DX8Graphics.cpp:331: error: undefined reference to 'EGL_Close'
    DX8Graphics.cpp:785: error: undefined reference to 'EGL_SwapBuffers'
    collect2: ld returned 1 exit status
    make: *** [../hurricanlinux] Error 1

    Leave a comment:


  • danboid
    replied
    defs to compile Hurrican for GL2?

    I've already pasted the startup output of Hurrican with its default build options, which I believe chooses EGL - right? I'm not even sure about that.

    I have only been successful in compling Hurrican with its default defines, every time I try and remove EGL or GLES it fails to compile.

    My last attempt to compile Hurrican just for GL2 looked like this, and of course it fails:

    Code:
    ifeq ($(TARGET),linux)
    EXE := ../hurricanlinux
    CCP := gcc
    CC  := gcc
    LD  := g++
    RM  := rm -f
    
    USE_EGL := no
    USE_GL2 := yes
    
    DEFINES += -DLINUX -DUSE_GL2 -DRGBA_5551
    
    INCLUDES_OS := -I/usr/include -I/usr/include/SDL -I/usr/include/libmodplug
    
    LDFLAGS := -g -lSDL -lSDL_mixer -lSDL_image -lmodplug -lX11
    
    endif
    GCC cries:

    Code:
    SDLPort/cshader.o -g -lSDL -lSDL_mixer -lSDL_image -lmodplug -lX11 -o ../hurricanlinux
    CCracktro.cpp:180: error: undefined reference to 'glClear'
    DX8Graphics.cpp:386: error: undefined reference to 'glGetString'
    DX8Graphics.cpp:388: error: undefined reference to 'glGetString'
    DX8Graphics.cpp:390: error: undefined reference to 'glGetString'
    DX8Graphics.cpp:393: error: undefined reference to 'glGetString'
    DX8Graphics.cpp:400: error: undefined reference to 'glClearColor'
    DX8Graphics.cpp:401: error: undefined reference to 'glClearDepth'
    DX8Graphics.cpp:403: error: undefined reference to 'glDisable'
    DX8Graphics.cpp:404: error: undefined reference to 'glEnable'
    DX8Graphics.cpp:439: error: undefined reference to 'glViewport'
    DX8Graphics.cpp:539: error: undefined reference to 'glBlendFunc'
    DX8Graphics.cpp:558: error: undefined reference to 'glBlendFunc'
    DX8Graphics.cpp:577: error: undefined reference to 'glBlendFunc'
    DX8Graphics.cpp:700: error: undefined reference to 'glEnableVertexAttribArray'
    DX8Graphics.cpp:701: error: undefined reference to 'glVertexAttribPointer'
    DX8Graphics.cpp:704: error: undefined reference to 'glEnableVertexAttribArray'
    DX8Graphics.cpp:705: error: undefined reference to 'glVertexAttribPointer'
    DX8Graphics.cpp:707: error: undefined reference to 'glEnableVertexAttribArray'
    DX8Graphics.cpp:708: error: undefined reference to 'glVertexAttribPointer'
    DX8Graphics.cpp:711: error: undefined reference to 'glUniformMatrix4fv'
    DX8Graphics.cpp:714: error: undefined reference to 'glDrawArrays'
    DX8Graphics.cpp:726: error: undefined reference to 'glDisableVertexAttribArray'
    DX8Graphics.cpp:727: error: undefined reference to 'glDisableVertexAttribArray'
    DX8Graphics.cpp:730: error: undefined reference to 'glDisableVertexAttribArray'
    DX8Graphics.cpp:757: error: undefined reference to 'glBindTexture'
    DX8Graphics.cpp:765: error: undefined reference to 'glBindTexture'
    DX8Graphics.cpp:791: error: undefined reference to 'glGetError'
    Gameplay.cpp:231: error: undefined reference to 'glClear'
    Gameplay.cpp:841: error: undefined reference to 'glClear'
    Menu.cpp:626: error: undefined reference to 'glClear'
    Tileengine.cpp:295: error: undefined reference to 'glDeleteTextures'
    SDLPort/texture.cpp:79: error: undefined reference to 'glGenTextures'
    SDLPort/texture.cpp:82: error: undefined reference to 'glBindTexture'
    SDLPort/texture.cpp:85: error: undefined reference to 'glTexParameteri'
    SDLPort/texture.cpp:86: error: undefined reference to 'glTexParameteri'
    SDLPort/texture.cpp:87: error: undefined reference to 'glTexParameteri'
    SDLPort/texture.cpp:88: error: undefined reference to 'glTexParameteri'
    SDLPort/texture.cpp:93: error: undefined reference to 'glCompressedTexImage2D'
    SDLPort/texture.cpp:98: error: undefined reference to 'glTexImage2D'
    SDLPort/texture.cpp:104: error: undefined reference to 'glGetError'
    SDLPort/texture.cpp:366: error: undefined reference to 'glDeleteTextures'
    SDLPort/texture.cpp:380: error: undefined reference to 'glDeleteTextures'
    SDLPort/cshader.cpp:50: error: undefined reference to 'glDeleteShader'
    SDLPort/cshader.cpp:55: error: undefined reference to 'glDeleteProgram'
    SDLPort/cshader.cpp:100: error: undefined reference to 'glUseProgram'
    SDLPort/cshader.cpp:134: error: undefined reference to 'glCreateShader'
    SDLPort/cshader.cpp:135: error: undefined reference to 'glShaderSource'
    SDLPort/cshader.cpp:136: error: undefined reference to 'glCompileShader'
    SDLPort/cshader.cpp:140: error: undefined reference to 'glGetShaderiv'
    SDLPort/cshader.cpp:169: error: undefined reference to 'glCreateProgram'
    SDLPort/cshader.cpp:172: error: undefined reference to 'glAttachShader'
    SDLPort/cshader.cpp:175: error: undefined reference to 'glLinkProgram'
    SDLPort/cshader.cpp:177: error: undefined reference to 'glGetProgramiv'
    SDLPort/cshader.cpp:198: error: undefined reference to 'glGetProgramiv'
    SDLPort/cshader.cpp:199: error: undefined reference to 'glGetProgramiv'
    SDLPort/cshader.cpp:208: error: undefined reference to 'glGetActiveAttrib'
    SDLPort/cshader.cpp:209: error: undefined reference to 'glGetAttribLocation'
    SDLPort/cshader.cpp:226: error: undefined reference to 'glGetProgramiv'
    SDLPort/cshader.cpp:236: error: undefined reference to 'glGetActiveUniform'
    SDLPort/cshader.cpp:237: error: undefined reference to 'glGetUniformLocation'
    SDLPort/cshader.cpp:279: error: undefined reference to 'glGetShaderiv'
    SDLPort/cshader.cpp:282: error: undefined reference to 'glGetShaderInfoLog'
    SDLPort/cshader.cpp:292: error: undefined reference to 'glGetProgramInfoLog'
    collect2: ld returned 1 exit status
    make: *** [../hurricanlinux] Error 1

    Leave a comment:


  • Pickle
    replied
    Originally posted by danboid View Post
    I'm using the non-free NV drivers btw.

    Can I set the renderer from the command line or must I recompile with specific defs? If so, what?

    The main artifact I see are a few thin rows of pixels floating below platforms. I'll do a screenshot if switching renderer backend doesn't fix it.
    The renderer API version is selected during runtime. Check out the readme in the source here section with important details:

    Code:
    Definitions:
      Platform Type
    	PLATFORM_DIRECTX : Use the original directx code
    	PLATFORM_SDL     : Use the new SDL/OpenGL code
    	__WIN32__	 : Use on windows builds
      OpenGL Options:
      	EGL		 : see SDLPort/eglport.h
    	USE_GL1          : Use the OpenGL 1.X code (fixed pipline)
    	USE_GLES1        : Use the OpenGL 1.X code with ES compatible (requires USE_GL1)
    	USE_GL2          : Use the OpenGL 2.0 code (programable pipline)
    	USE_GLES2        : Use the OpenGL 2.0 code with ES compatible (requires USE_GL2)
    	USE_PVRTC	 : Use ImgTec's PVRTC texture compression (only for PVR gpu's)
      Sound:
      	USE_MODPLUG      : Use the stable modplug code for music. (otherwise mikmod is used, which is known to have problems)
      	
      Other:
      	ENABLE_CONSOLE_COMMANDS : turns a console where commands can be entered
      	_DEBUG			: enables some debug output

    Leave a comment:


  • danboid
    replied
    Code:
    Initializing SDL.
    SDL initialized.
    EGL Opening EGL display
    EGL Opening X11 display
    EGL Initializing
    libEGL warning: DRI2: failed to authenticate
    EGL Implementation Version: Major 1 Minor 4
    EGL_VENDOR: Mesa Project
    EGL_VERSION: 1.4 (DRI2)
    EGL_EXTENSIONS: EGL_KHR_surfaceless_gles1 EGL_KHR_surfaceless_gles2 EGL_KHR_surfaceless_opengl 
    EGL Found 18 available configs
    EGL Using Config 0
    EGL Binding API
    EGL Creating Context
    EGL Creating window surface
    EGL Making Current
    EGL Complete
    GL_VENDOR: VMware, Inc.
    GL_RENDERER: Gallium 0.4 on llvmpipe (LLVM 0x300)
    GL_VERSION: OpenGL ES 2.0 Mesa 8.0.4
    GL_SHADING_LANGUAGE_VERSION: OpenGL ES GLSL ES 1.0.16
    GL_EXTENSIONS: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_OES_draw_texture GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot GL_OES_EGL_image GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_NV_draw_buffers 
    Shader: Compiling data/shaders/shader_color.vert
    Shader: Compiled data/shaders/shader_color.vert
    Shader: Compiling data/shaders/shader_color.frag
    Shader: Compiled data/shaders/shader_color.frag
    Shader: Compiling data/shaders/shader_texture.vert
    Shader: Compiled data/shaders/shader_texture.vert
    Shader: Compiling data/shaders/shader_texture.frag
    Shader: Compiled data/shaders/shader_texture.frag
    EGL Closed
    I'm using the non-free NV drivers btw.

    Can I set the renderer from the command line or must I recompile with specific defs? If so, what?

    The main artifact I see are a few thin rows of pixels floating below platforms. I'll do a screenshot if switching renderer backend doesn't fix it.

    Leave a comment:


  • Pickle
    replied
    Originally posted by danboid View Post
    I'd almost forgotten about Hurrican until today when I thought it was time to compile it and see if Pickle ever fixed the joypad support under Linux and indeed he did - exactly one year ago today as it turns out! What are the chances I'd try it again exactly one year after he implemented the one feature I wanted to see!?

    I've compiled it under buntu 12.04 (KXStudio amd64) - I'm getting some visual artifacts but I'm not sure if I was running it in GL or GLES mode - must try playing with the options.

    Might we be able to get Hurrican into Debian Pickle?

    Thanks for bringing such a polished free game to Linux!
    Thanks for trying and posting some feedback. The primary difference in rendering is choice between GL1 and GL2. The ES variant of either is not very much different from the normal desktop GL.

    The only graphical issues ive heard of is lines between tiles or maybe an bad line in tile. You can find some ideas i had about it a couple post back. I havnt had the problem occur on any of my devices.

    Its all open source so anyone can package it for debian, if thats what you mean ;-)

    Leave a comment:


  • danboid
    replied
    Great work Pickle! Good to play Hurrican with a joypad!

    I'd almost forgotten about Hurrican until today when I thought it was time to compile it and see if Pickle ever fixed the joypad support under Linux and indeed he did - exactly one year ago today as it turns out! What are the chances I'd try it again exactly one year after he implemented the one feature I wanted to see!?

    I've compiled it under buntu 12.04 (KXStudio amd64) - I'm getting some visual artifacts but I'm not sure if I was running it in GL or GLES mode - must try playing with the options.

    Might we be able to get Hurrican into Debian Pickle?

    Thanks for bringing such a polished free game to Linux!

    Leave a comment:

Working...
X