Are there any intrinsics for Vectors, Colors and matrices etc?

Started by
6 comments, last by lucky6969b 10 years, 9 months ago

Thanks.............

Jack

Advertisement

I find glm but the zip package is a bit strange, how do I install it?

Do I dump all hpp files to my visual C++ include directory?

Thanks

Jack

Don't dump anything into your visual studio installation. Put all your third party libraries into a separate directory of your choice and add include paths to the libraries in the project settings. In Visual studio 2012: Project->Properties->Configuration Properties->VC++ Directories->Include Directories.

How do I represent Colors in OpenGL? it seems it doesn't exist even in glm?

And seems like cal3d doesn't have inverse kinematics. Have to put every piece together.

Thanks

Jack

A 3 och 4-component vector works just fine. After all, a color is a point in a color space.

common.h


#include "glm.hpp"

#define UINT unsigned int
#define DWORD unsigned long

#define glColorRGBA glm::vec4

myOpenGLWidget.h


#pragma once
#include "openglwidget.h"
#include "common.h"
#include "glm.hpp"

class myOpenGLWidget :
    public OpenGLWidget
{
public:

#ifdef QWIDGET_H
    myOpenGLWidget( QWidget *parent = 0, Qt::WFlags flags = 0 );
#else
    myOpenGLWidget();
    
#endif

    

    virtual ~myOpenGLWidget();
    
    virtual void initCamera();
    virtual void initModels();
    
    virtual void initEffects();

    //-----------------------------------------------------------------------------
    // Name: initialize()
    // Desc: This function will only be called once during the application's
    //       initialization phase. Therefore, it can't contain any resources that
    //       need to be restored every time the OpenGL device is lost or the
    //       window is resized.
    //-----------------------------------------------------------------------------
    bool initialize();
    
    //-----------------------------------------------------------------------------
    // Name: uninitialize()
    // Desc: Releases all previously initialized objects
    //-----------------------------------------------------------------------------
    void uninitialize();
    
    virtual void update();
    

    //-----------------------------------------------------------------------------
    // Name: restoreDeviceObjects()
    // Desc: You are encouraged to develop applications with a single code path to
    //       respond to device loss. This code path is likely to be similar, if not
    //       identical, to the code path taken to initialize the device at startup.
    //-----------------------------------------------------------------------------
    bool    restoreDeviceObjects();

    //-----------------------------------------------------------------------------
    // Name: invalidateDeviceObjects()
    // Desc: If the lost device can be restored, the application prepares the
    //       device by destroying all video-memory resources and any
    //       swap chains. This is typically accomplished by using the SAFE_RELEASE
    //       macro.
    //-----------------------------------------------------------------------------
    bool invalidateDeviceObjects();
    
    //-----------------------------------------------------------------------------
    // Name: render()
    // Desc: Draws the scene
    //-----------------------------------------------------------------------------
    virtual bool    render();
    
    //-----------------------------------------------------------------------------
    // Name: clearScene()
    // Desc: Clear the render target and depth stencil
    //-----------------------------------------------------------------------------
    void    clearScene(  glColorRGBA ClearColor, float Z, DWORD Stencil );
    
    //-----------------------------------------------------------------------------
    // Name: clearRenderTarget()
    // Desc: Clear the render target
    //-----------------------------------------------------------------------------
    void    clearRenderTarget( glColorRGBA ClearColor );

glColorRGBA and DWORD are not defined.

Wondering why

Thanks

Jack

I see no reason why that would happen in the code you have posted. And when posting errors, show the exact error message. But as an aside, there's no reason to use defines to make type aliases; use typedefs for that.

Thanks!, it is working like a charm.

This topic is closed to new replies.

Advertisement