Re: [osg-users] [build] OpenGLES2.0 build error

2011-09-09 Thread Robert Osfield
HI Tibias,

In OpenGL ES 2.0 the fixed function pipeline is not available so you
have to switch this off with:
OSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=OFF

Robert.

2011/9/9 Tobias Weißhaar :
> Hi guys,
>
> Now I have generated a project with this command:
>
> cmake -G Xcode \
> -DOSG_BUILD_PLATFORM_IPHONE_SIMULATOR:BOOL=ON \
> -DBUILD_OSG_APPLICATIONS:BOOL=OFF \
> -DBUILD_OSG_EXAMPLES:BOOL=OFF \
> -DOSG_BUILD_FRAMEWORKS:BOOL=OFF \
> -DOSG_WINDOWING_SYSTEM:STRING=IOS \
> -DCMAKE_OSX_ARCHITECTURES:STRING=i386 \
> -DOSG_GL1_AVAILABLE:BOOL=OFF \
> -DOSG_GL2_AVAILABLE:BOOL=OFF \
> -DOSG_GLES2_AVAILABLE:BOOL=ON \
> -DOSG_GL_DISPLAYLISTS_AVAILABLE:BOOL=OFF \
> -DOSG_GL_FIXED_FUNCTION_AVAILABLE:BOOL=ON \
> -DOSG_GL_LIBRARY_STATIC:BOOL=OFF \
> -DOSG_GL_MATRICES_AVAILABLE:BOOL=ON \
> -DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE:BOOL=ON \
> -DOSG_GL_VERTEX_FUNCS_AVAILABLE:BOOL=OFF \
> -DDYNAMIC_OPENSCENEGRAPH:BOOL=OFF \
> -DDYNAMIC_OPENTHREADS:BOOL=OFF \
>
> I want to use OpenGLES2.0 and not 1.0. With 1.0 all went fine but now I get 
> errors like this:
>
> glLoadMatrix has not been declared
> GL_VERTEX_ARRAY has not been declared
> ...
>
>
> Thank you!
>
> Cheers,
> Tobias
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=42557#42557
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2011-09-09 Thread Tobias Weißhaar
Hi,

OK i got it :)


Thank you!

Cheers,
Tobias

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=42563#42563





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-08 Thread Mike Wozniewski
Hi Tobias,

Is there any chance you can post your cmake command that builds for OpenGL ES2? 
I tried yours (had to change the SDK to 5.0) but I get a ton of compile errors, 
starting with:

'glLoadMatrixf' was not declared in this scope

Thanks,
Mike

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46116#46116





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-09 Thread Jordi Torres
Hi Mike,

Attached is a cmake toolchain to build osg against GLES2. You need to
comment lines from 204 - 207 in the CMakeLists.txt:

  #the below is taken from ogre, it states the gcc stuff needs to happen
before PROJECT() is called. I've no clue if we even need it
# Force gcc <= 4.2 on iPhone
#include(CMakeForceCompiler)
#CMAKE_FORCE_C_COMPILER(gcc-4.2 GNU)
#CMAKE_FORCE_CXX_COMPILER(gcc-4.2 GNU)
#SET(GCC_THUMB_SUPPORT NO)

And then simply do:
$cmake  -DCMAKE_TOOLCHAIN_FILE=iOS5_GLES2.cmake and make install
or if you prefer to compile in XCode:
 $cmake -GXCode  -DCMAKE_TOOLCHAIN_FILE=iOS5_GLES2.cmake


If it solves your problem please report here and I will try to submit this
with a simple GLES2 example.

Cheers.

2012/3/8 Mike Wozniewski 

> Hi Tobias,
>
> Is there any chance you can post your cmake command that builds for OpenGL
> ES2? I tried yours (had to change the SDK to 5.0) but I get a ton of
> compile errors, starting with:
>
> 'glLoadMatrixf' was not declared in this scope
>
> Thanks,
> Mike
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46116#46116
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es
# force CMake to assume crosscompiling
set(CMAKE_CROSSCOMPILING 1)

# assume we are somewhat on a Darwin system
set(CMAKE_SYSTEM_NAME Darwin)
set(CMAKE_SYSTEM_PROCESSOR arm )

# set the platform flags manually
set(APPLE 1)
set(IOS 1)

# hard set values
set(IOS_SDK_VERSION "5.0")
set(IOS_TARGET "iPhoneOS")
set(IOS_ARCH "armv7")

# some internal values
set(IOS_DEVELOPER_ROOT "/Developer/Platforms/${IOS_TARGET}.platform/Developer")
set(IOS_SDK_ROOT "${IOS_DEVELOPER_ROOT}/SDKs/${IOS_TARGET}${IOS_SDK_VERSION}.sdk")

# for Xcode 4.x we need to set the sysroot to the internal string
if(XCODE)
set(CMAKE_OSX_SYSROOT "${IOS_SDK_ROOT}" CACHE STRING "SDK version" FORCE)
else()
set(CMAKE_OSX_SYSROOT "${IOS_SDK_ROOT}" CACHE STRING "SDK version" FORCE)
endif()

#
set(CMAKE_OSX_ARCHITECTURES "${IOS_ARCH}" CACHE STRING "SDK Architecture" FORCE)

# default to searching for frameworks first
set (CMAKE_FIND_FRAMEWORK FIRST)


# set up the default search directories for frameworks
set (CMAKE_SYSTEM_FRAMEWORK_PATH
${IOS_SDK_ROOT}/System/Library/Frameworks
${IOS_SDK_ROOT}/System/Library/PrivateFrameworks
${IOS_SDK_ROOT}/Developer/Library/Frameworks
)

# set appropriate flags
set(CMAKE_C_FLAGS "--sysroot=${IOS_SDK_ROOT} -miphoneos-version-min=${IOS_SDK_VERSION} -arch ${IOS_ARCH} -v" CACHE STRING "C flags" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "C++ flags" FORCE)

# specify compiler
set(CMAKE_C_COMPILER "${IOS_DEVELOPER_ROOT}/usr/bin/clang" CACHE PATH "C compiler" FORCE)
set(CMAKE_CXX_COMPILER "${IOS_DEVELOPER_ROOT}/usr/bin/clang++" CACHE PATH "C++ compiler" FORCE)

# for Xcode we need to skip the compiler introspection
if(XCODE)
set(CMAKE_CXX_COMPILER_WORKS TRUE)
set(CMAKE_C_COMPILER_WORKS TRUE)
endif()
# root path settings
set(CMAKE_FIND_ROOT_PATH
${IOS_DEVELOPER_ROOT}
${IOS_SDK_ROOT}/usr
${IOS_SDK_ROOT}/System
)
FIND_LIBRARY(OPENGLES_LIBRARY OpenGLES)
# search paths (for makefiles the first one might be switched to "NEVER")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

SET(OSG_WINDOWING_SYSTEM "IOS" CACHE STRING "Forced IPhone windowing system on iOS"  FORCE)
SET(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX "imageio" CACHE STRING "Forced imageio default image plugin for iOS" FORCE)

#set OpenGL_ES2 Flags
SET(OSG_BUILD_PLATFORM_IPHONE "ON" CACHE STRING  "Forced iOS Platform" FORCE)
SET(OSG_GL1_AVAILABLE "OFF" CACHE STRING  "Forced for GLES2 compilation" FORCE ) 
SET(OSG_GL2_AVAILABLE "OFF" CACHE STRING  "Forced for GLES2 compilation" FORCE) 
SET(OSG_GLES1_AVAILABLE "OFF" CACHE STRING  "Forced for GLES2 compilation" FORCE)
SET(OSG_GLES2_AVAILABLE "ON" CACHE STRING  "Forced for GLES2 compilation" FORCE)
SET(OSG_GL_DISPLAYLISTS_AVAILABLE "OFF" CACHE STRING  "Forced iOS Platform" FORCE)
SET(OSG_GL_LIBRARY_STATIC "OFF" CACHE STRING  "Forced iOS Platform" FORCE)
SET(OSG_GL_MATRICES_AVAILABLE "OFF" CACHE STRING  "Forced for GLES2 compilation" FORCE)
SET(OSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE "OFF" CACHE STRING  "Forced for GLES2 compilation" FORCE)
SET(OSG_GL_VERTEX_FUNCS_AVAILABLE "OFF" CACHE STRING  "Forced for GLES2 compilation" FORCE)
SET(DYNAMIC_OPENSCENEGRAPH "OFF" CACHE STRING  "Forced iOS Platform" FORCE)
SET(DYNAMIC_OPENTHREADS "OFF" CACHE STRING  "Forced iOS Platform" FORCE)
SET(_OPENTHREADS_ATOMIC_USE_GCC_BUILTINS_EXITCODE "0" CACHE STRING  "Forced iOS Platform" FORCE)
SET (BUILD_OSG_APPLICATIONS "OFF" CACHE STRING  "Forced iOS Platform" FORCE)
SET(_O

Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-09 Thread Jordi Torres
I guess you are trying to compile for iOS5, if you are not sorry for the
noise.

Cheers.

2012/3/9 Jordi Torres 

> Hi Mike,
>
> Attached is a cmake toolchain to build osg against GLES2. You need to
> comment lines from 204 - 207 in the CMakeLists.txt:
>
>   #the below is taken from ogre, it states the gcc stuff needs to happen
> before PROJECT() is called. I've no clue if we even need it
> # Force gcc <= 4.2 on iPhone
> #include(CMakeForceCompiler)
> #CMAKE_FORCE_C_COMPILER(gcc-4.2 GNU)
> #CMAKE_FORCE_CXX_COMPILER(gcc-4.2 GNU)
> #SET(GCC_THUMB_SUPPORT NO)
>
> And then simply do:
> $cmake  -DCMAKE_TOOLCHAIN_FILE=iOS5_GLES2.cmake and make install
> or if you prefer to compile in XCode:
>  $cmake -GXCode  -DCMAKE_TOOLCHAIN_FILE=iOS5_GLES2.cmake
>
>
> If it solves your problem please report here and I will try to submit this
> with a simple GLES2 example.
>
> Cheers.
>
> 2012/3/8 Mike Wozniewski 
>
>> Hi Tobias,
>>
>> Is there any chance you can post your cmake command that builds for
>> OpenGL ES2? I tried yours (had to change the SDK to 5.0) but I get a ton of
>> compile errors, starting with:
>>
>> 'glLoadMatrixf' was not declared in this scope
>>
>> Thanks,
>> Mike
>>
>> --
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=46116#46116
>>
>>
>>
>>
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> Jordi Torres Fabra
>
> gvSIG 3D blog
> http://gvsig3d.blogspot.com
> Instituto de Automática e Informática Industrial
> http://www.ai2.upv.es
>



-- 
Jordi Torres Fabra

gvSIG 3D blog
http://gvsig3d.blogspot.com
Instituto de Automática e Informática Industrial
http://www.ai2.upv.es
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-15 Thread Mike Wozniewski
Hi Jordi,

Thanks for the instructions, and sorry for taking so long to respond. I had to 
upgrade Xcode to 4.3.1 for a different project and ran into many projects. I'm 
wondering if this is responsible for your cmake toolchain not working for me.

XCode 4.3.1 is the .app version, which removes your /Developer folder, which is 
a pretty significant change.

I had to change your toolchain file to point to the new SDK location:

Code:

#set(IOS_DEVELOPER_ROOT "/Developer/Platforms/${IOS_TARGET}.platform/Developer")
set(IOS_DEVELOPER_ROOT 
"/Applications/Xcode.app/Contents/Developer/Platforms/${IOS_TARGET}.platform/Developer")




But when I run cmake, I get a compiler error:

Code:

$ cmake -DCMAKE_TOOLCHAIN_FILE=iOS5_GLES2.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
-- The C compiler identification is Clang
-- The CXX compiler identification is Clang
-- Check for working C compiler: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES
CMake Error: Error required internal CMake variable not set, cmake may be not 
be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_SUFFIXES
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: 
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang
 -- broken
CMake Error at /opt/local/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 
(MESSAGE):
The C compiler
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang"
is not able to compile a simple test program.

It fails with the following output:

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:36 (PROJECT)

-- Configuring incomplete, errors occurred!




I saw in another post (http://forum.openscenegraph.org/viewtopic.php?t=9951) 
that you were using clang. What version?

Mike is:
Apple clang version 3.0 (tags/Apple/clang-211.11) (based on LLVM 3.0svn)
Target: x86_64-apple-darwin11.3.0

How far are you from finishing your GLES2 example? I'm eager to try it... 
assuming I can get OSG to build properly.

Any ideas are highly appreciated.

Thanks,
Mike

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46328#46328





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-15 Thread Mike Wozniewski
Oops. Ignore that last post. I forgot to also update IOS_SDK_VERSION to 5.1 in 
your toolchain file. Now it successfully configures. Will keep you posted once 
I finish building everything.

-Mike

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46329#46329





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-26 Thread Mike Wozniewski
Okay another update:

I managed to successfully build OSG using Jordi's cmake toolchain. I still 
needed to do another few things:

- build my own universal freetype library for iOS and set the proper variables 
in the toolchain
- add the CoreGraphics and ImageUI frameworks to the linker flags
- enable code signing

So I can successfully build the example_osgViewerIPhone target, and it runs on 
my device, but I don't see anything - just a blank viewer with the standard 
blue background.

There are some errors related to shaders not being attached properly:

Code:

Warning: detected OpenGL error 'invalid enumerant' at Before Renderer::compile
VERTEX glCompileShader "" FAILED
VERTEX Shader "" infolog:
ERROR: 0:8: Use of undeclared identifier 'gl_FrontColor'

FRAGMENT glCompileShader "" FAILED
FRAGMENT Shader "" infolog:
ERROR: 0:4: 'vec4' : declaration must include a precision qualifier for type
ERROR: 0:5: Use of undeclared identifier 'base'
ERROR: 0:6: Use of undeclared identifier 'color'
ERROR: 0:6: Use of undeclared identifier 'gl_Color'
ERROR: 0:7: Use of undeclared identifier 'color'

glLinkProgram "" FAILED
Program "" infolog:
ERROR: One or more attached shaders not successfully compiled




I don't see any shaders in the example... I guess this is something upstream in 
OSG? Does anyone have an idea of why the example isn't working? Are there any 
OpenGL ES 2.0 examples out there?

Thanks,
Mike[/code]

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46605#46605





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-27 Thread Jorge Izquierdo Ciges
GLSL shaders in OpenGL ES 2.0 need precision qualification values.

2012/3/27 Mike Wozniewski 

> Okay another update:
>
> I managed to successfully build OSG using Jordi's cmake toolchain. I still
> needed to do another few things:
>
> - build my own universal freetype library for iOS and set the proper
> variables in the toolchain
> - add the CoreGraphics and ImageUI frameworks to the linker flags
> - enable code signing
>
> So I can successfully build the example_osgViewerIPhone target, and it
> runs on my device, but I don't see anything - just a blank viewer with the
> standard blue background.
>
> There are some errors related to shaders not being attached properly:
>
> Code:
>
> Warning: detected OpenGL error 'invalid enumerant' at Before
> Renderer::compile
> VERTEX glCompileShader "" FAILED
> VERTEX Shader "" infolog:
> ERROR: 0:8: Use of undeclared identifier 'gl_FrontColor'
>
> FRAGMENT glCompileShader "" FAILED
> FRAGMENT Shader "" infolog:
> ERROR: 0:4: 'vec4' : declaration must include a precision qualifier for
> type
> ERROR: 0:5: Use of undeclared identifier 'base'
> ERROR: 0:6: Use of undeclared identifier 'color'
> ERROR: 0:6: Use of undeclared identifier 'gl_Color'
> ERROR: 0:7: Use of undeclared identifier 'color'
>
> glLinkProgram "" FAILED
> Program "" infolog:
> ERROR: One or more attached shaders not successfully compiled
>
>
>
>
> I don't see any shaders in the example... I guess this is something
> upstream in OSG? Does anyone have an idea of why the example isn't working?
> Are there any OpenGL ES 2.0 examples out there?
>
> Thanks,
> Mike[/code]
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=46605#46605
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [build] OpenGLES2.0 build error

2012-03-29 Thread Mike Wozniewski
Hi Jordi,

Thanks for the example. I couldn't figure out the CMake stuff, so I had to 
build my own XCode project, but it worked! So it seems like my OSG build now 
supports GLES2. !!

Now on to porting my existing iOS projects to use this new rendering 
pipeline... fun.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=46689#46689





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org