Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/VideoTexture/ImageBuff.cpp
| Context not available. | |||||
| // use ImBuf API for image manipulation | // use ImBuf API for image manipulation | ||||
| extern "C" { | extern "C" { | ||||
| #include "IMB_imbuf_types.h" | #include "DNA_imbuf_types.h" | ||||
| #include "IMB_imbuf.h" | #include "IMB_imbuf.h" | ||||
| #include "bgl.h" | #include "bgl.h" | ||||
| }; | }; | ||||
| Context not available. | |||||
| // assign temporarily our buffer to the ImBuf buffer, we use the same format | // assign temporarily our buffer to the ImBuf buffer, we use the same format | ||||
| tmpbuf->rect = (unsigned int*)img; | tmpbuf->rect = (unsigned int*)img; | ||||
| m_imbuf->rect = m_image; | m_imbuf->rect = m_image; | ||||
| IMB_rectblend(m_imbuf, m_imbuf, tmpbuf, NULL, NULL, NULL, 0, x, y, x, y, 0, 0, width, height, (IMB_BlendMode)mode, false); | IMB_rectblend(m_imbuf, m_imbuf, tmpbuf, NULL, NULL, NULL, 0, x, y, x, y, 0, 0, width, height, (IMB_BlendMode)mode, false, 2); | ||||
| // remove so that MB_freeImBuf will free our buffer | // remove so that MB_freeImBuf will free our buffer | ||||
| m_imbuf->rect = NULL; | m_imbuf->rect = NULL; | ||||
| tmpbuf->rect = NULL; | tmpbuf->rect = NULL; | ||||
| Context not available. | |||||
| // assign temporarily our buffer to the ImBuf buffer, we use the same format | // assign temporarily our buffer to the ImBuf buffer, we use the same format | ||||
| img->m_imbuf->rect = img->m_image; | img->m_imbuf->rect = img->m_image; | ||||
| m_imbuf->rect = m_image; | m_imbuf->rect = m_image; | ||||
| IMB_rectblend(m_imbuf, m_imbuf, img->m_imbuf, NULL, NULL, NULL, 0, x, y, x, y, 0, 0, img->m_imbuf->x, img->m_imbuf->y, (IMB_BlendMode)mode, false); | IMB_rectblend(m_imbuf, m_imbuf, img->m_imbuf, NULL, NULL, NULL, 0, x, y, x, y, 0, 0, img->m_imbuf->x, img->m_imbuf->y, (IMB_BlendMode)mode, false, 2); | ||||
| // remove so that MB_freeImBuf will free our buffer | // remove so that MB_freeImBuf will free our buffer | ||||
| m_imbuf->rect = NULL; | m_imbuf->rect = NULL; | ||||
| img->m_imbuf->rect = NULL; | img->m_imbuf->rect = NULL; | ||||
| Context not available. | |||||