/**
* \brief Create a layer which should be managed by the service
- * \deprecated Will be removed in later version please use ilm_layerCreateWithDimension
- * \ingroup ilmControl
- * \param[out] pLayerId pointer where the id should be/is stored. It is possible
- * to set a id from outside, 0 will create a new id.
- * \return ILM_SUCCESS if the method call was successful
- * \return ILM_FAILED if the client can not call the method on the service.
- */
-ilmErrorTypes ilm_layerCreate(t_ilm_layer* pLayerId);
-
-/**
- * \brief Create a layer which should be managed by the service
* \ingroup ilmControl
* \param[out] pLayerId pointer where the id should be/is stored. It is possible
* to set a id from outside, 0 will create a new id.
return returnValue;
}
-
-ilmErrorTypes ilm_layerCreate(t_ilm_layer* pLayerId)
-{
- ilmErrorTypes returnValue = ILM_FAILED;
-
- if (pLayerId && (INVALID_ID != *pLayerId))
- {
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("CreateLayerFromId");
- if (command
- && gIpcModule.appendUint(command, *pLayerId)
- && sendAndWaitForResponse(command, &response, RESPONSE_TIMEOUT_IN_MS, &returnValue)
- && gIpcModule.getUint(response, pLayerId))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- }
- else
- {
- t_ilm_message response = 0;
- t_ilm_message command = gIpcModule.createMessage("CreateLayer");
- if (command
- && sendAndWaitForResponse(command, &response, RESPONSE_TIMEOUT_IN_MS, &returnValue)
- && gIpcModule.getUint(response, pLayerId))
- {
- returnValue = ILM_SUCCESS;
- }
- gIpcModule.destroyMessage(response);
- gIpcModule.destroyMessage(command);
- }
- return returnValue;
-}
-
ilmErrorTypes ilm_layerCreateWithDimension(t_ilm_layer* pLayerId, t_ilm_uint width, t_ilm_uint height)
{
ilmErrorTypes returnValue = ILM_FAILED;
}
//=============================================================================
-COMMAND("create layer <layerid> [<width> <height>]")
+COMMAND("create layer <layerid> <width> <height>")
//=============================================================================
{
- if (input->contains("width") && input->contains("height"))
- {
- unsigned int layerid = input->getUint("layerid");
- unsigned int width = input->getUint("width");
- unsigned int height = input->getUint("height");
+ unsigned int layerid = input->getUint("layerid");
+ unsigned int width = input->getUint("width");
+ unsigned int height = input->getUint("height");
- ilmErrorTypes callResult = ilm_layerCreateWithDimension(&layerid, width, height);
- if (ILM_SUCCESS != callResult)
- {
- cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
- cout << "Failed to create layer with ID " << layerid << "\n";
- return;
- }
- }
- else
+ ilmErrorTypes callResult = ilm_layerCreateWithDimension(&layerid, width, height);
+ if (ILM_SUCCESS != callResult)
{
- unsigned int layerid = input->getUint("layerid");
-
- ilmErrorTypes callResult = ilm_layerCreate(&layerid);
- if (ILM_SUCCESS != callResult)
- {
- cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
- cout << "Failed to create layer with ID " << layerid << "\n";
- return;
- }
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer with ID " << layerid << "\n";
+ return;
}
}
extraLayer = pScene->layers[0];
}
- ilmErrorTypes callResult = ilm_layerCreate(&extraLayer);
+ t_ilm_uint screenWidth;
+ t_ilm_uint screenHeight;
+ ilmErrorTypes callResult = ilm_getScreenResolution(0, &screenWidth, &screenHeight);
+ if (ILM_SUCCESS != callResult)
+ {
+ cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";
+ cout << "Failed to create layer\n";
+ }
+
+ callResult = ilm_layerCreateWithDimension(&extraLayer, screenWidth, screenHeight);
if (ILM_SUCCESS != callResult)
{
cout << "LayerManagerService returned: " << ILM_ERROR_STRING(callResult) << "\n";